Character Encoding - Issue
Solved
lourdchien
Posted messages
7
Status
Membre
-
lourdchien Posted messages 7 Status Membre -
lourdchien Posted messages 7 Status Membre -
Hello,
I have two PHP pages (XHTML 1.0 content) on the same local site, both using the same tag for character encoding:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Yet, accented letters are recognized in one page, while in the other, they are all replaced by a ? (question mark on a black background). I specify that the problem concerns the entirety of the page, not just imported content (from MySQL, for example).
What could be the problem?
Configuration: Linux / Firefox 3.6.3
I have two PHP pages (XHTML 1.0 content) on the same local site, both using the same tag for character encoding:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Yet, accented letters are recognized in one page, while in the other, they are all replaced by a ? (question mark on a black background). I specify that the problem concerns the entirety of the page, not just imported content (from MySQL, for example).
What could be the problem?
Configuration: Linux / Firefox 3.6.3
3 réponses
Try this at the beginning of the page (just after your DB connection)
--
He’s got it free, he understands everything!
mysql_query("SET NAMES UTF8"); --
He’s got it free, he understands everything!
lourdchien
Posted messages
7
Status
Membre
Unfortunately, it doesn't work; the problem is not related to the database. However, the two .php files were not created with the same software...
The problem may stem from a poor configuration of the HTML editor, as the charset meta declaration is not enough.
For example, with NotePad++, you need to check in the format menu if the specified encoding is indeed utf-8 and not ansi.
--
<blockquote cite="Shakespeare">To be or not to be; that is the question...</blockquote>
For example, with NotePad++, you need to check in the format menu if the specified encoding is indeed utf-8 and not ansi.
--
<blockquote cite="Shakespeare">To be or not to be; that is the question...</blockquote>