1

When I echo values with non-latin characters from MySQL they turn into question marks. And I mean question marks "?" not "�". I got these things:

header('Content-Type: text/html; charset=ISO-8859-2'); //php

<meta name="charset" content="ISO-8859-2" />//html

And they're not working!

Requesting help.

EDIT: More informations: in PHPMyAdmin I changed collation to utf8_polish_ci.

Jerry Sky
  • 11
  • 1
  • 6

1 Answers1

0

You might want to try issuing this SQL statement right after you connect:

SET character_set_results = latin2 

It looks like your text is getting translated, by MySQL, from Unicode to latin-1 (iso-8859-1); the question marks you're seeing are replacement characters. MySQL translates text from its internal representation to the character set of the connection when it sends result sets.

You can read more about this here. http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

O. Jones
  • 103,626
  • 17
  • 118
  • 172
  • When I did that what you recommended, that words with polish characters disappeared. When I changed "latin2" to "latin1" or "latin3" words appeared, but with question marks. – Jerry Sky Jan 26 '15 at 23:07