0

i'm having some troubles with UTF-8 encoding on a website. Calling my script using PHP5 all the umlauts (ä, ü, ö,...) look like this: ökflödsköl

Calling the script using PHP4 shows everything as expected...

both php.ini look the same an so my question would be:

is there an other file where i can change the output encoding?

Thanks

5
  • We can't tell without the code you're using. Commented Feb 9, 2010 at 6:33
  • Encoding is confusing - could be a PHP thing, an Apache thing or a MySql thing (assuming you're on *AMP ) Commented Feb 9, 2010 at 6:36
  • echo '<h1>'.nl2br(htmlentities($elem->headline)).'</h1>'; while $elem->headline is a String comming out of a Database. Commented Feb 9, 2010 at 6:44
  • Are you testing with a web browser? What encoding is sent in the headers? Commented Feb 9, 2010 at 6:54
  • oh thanks, encoding is iso-8859-1, don't know why but i'm going to change this Commented Feb 9, 2010 at 7:05

2 Answers 2

2

You need to tell htmlentities to use UTF-8

htmlentities($foo, null, 'UTF-8');

I hope that helps :)

Sign up to request clarification or add additional context in comments.

Comments

0

New Status: if i remove htmlentities() it all looks great...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.