2

Possible Duplicate:
PHP messing with HTML Charset Encoding

We've come across special characters being transformed.

What is causing this? How can we fix it?

For example:

ë becomes ë

Thank you.

Community
  • 1
  • 1
Latox
  • 4,655
  • 15
  • 48
  • 74
  • Where is this happening? During PHP parsing or once the data is submitted into the DB? – Prisoner Sep 30 '11 at 11:13
  • 2
    Duplicate, asked a lot of times, for instance http://stackoverflow.com/questions/7522956/strange-character-in-fresh-wamp-installation and http://stackoverflow.com/questions/7501924/php-messing-with-html-charset-encoding – Fabio Sep 30 '11 at 11:26
  • ë is an actual UTF8 character. While ë is the expected utf8 character. See this usefull link: http://www.i18nqa.com/debug/utf8-debug.html – Julian Jan 09 '17 at 14:38

4 Answers4

5

Thats a utf-8 character and you can parse it through utf8_encode() and utf8_decode() in PHP

Keenora Fluffball
  • 1,647
  • 2
  • 18
  • 34
2

Charset can be set at numerous places.

  • table charset
  • field charset
  • PHP-MySQL connection charset
  • Apache default charset
  • and in HTML metainfo

Make sure you use UTF-8 everywhere, and don't forget to setup the connection properly before the first query:

mysql_query("SET NAMES 'utf8'");
erenon
  • 18,838
  • 2
  • 61
  • 93
0

Make sure you are setting your charset in HTML document and with PHP header's function.

Also, you could try to make the first query in MySQL to be SET NAMES=UTF8 (SET NAMES utf8 in MySQL?)

Community
  • 1
  • 1
ChrisH
  • 1,283
  • 1
  • 9
  • 22
0

If this is the output of a PHP script, I guess you may consider mb_internal_encoding() function.

Or you can fix that by HTML encoding meta tag. Like <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> inside <head>...</head>.

M. Suleiman
  • 858
  • 4
  • 22