Hi all.
I have an odd problem with accented letters becoming garbled. Consider this snippet (I have the charset set to UTF-8 in the meta content of this document):
<?php
$foo = 'étoile';
echo $foo;
?>
The above works fine. The text is printed with the accent intact. But now look at this. First, a modification to the above (again, same charset):
<?php
include 'set_variable.php';
echo $foo;
?>
And this is what's in set_variable.php:
<?php
$foo = 'étoile';
?>
If I do it like this, then the accented e in the variable $foo is garbled. A lozenge with a question mark. I have no idea why. I cannot pass any strings with accented characters in them. They all come out garbled.
I looked in the php.ini file and set default_charset = "utf-8". Same. So I cut it out completely. Same. So I set default_charset = "iso-8859-1". Still garbled but not a lozenge this time.
I looked in the httpd.conf and added this:
#AddCharset UTF-8 .utf8
#AddDefaultCharset UTF-8
Same. The problem just will not go away.
Does anybody have any idea how to fix this?
Thanks for any input.
Mark
I use Vista Home Premium, PHP 5.2.9-2, Apache 2.2.11.
note: use can use [code] tags