1

I have a trouble displaying Cyrillic characters properly. Looked in forums, tried a few different thing and nothing works.

Site runs on PHP / MySQL.

MySQL tables charset is utf8, and collation is utf8_general_ci Name entry in DB looks correct (in PhpmyAdmin): Sasha Рукина

Output on page http://www.sodaq.com/: Sasha ??????

Inside PHP I use:

mb_internal_encoding("UTF-8"); mb_http_output("UTF-8");

And send HTTP header 'Content-type: text/html; charset=utf-8'

Still, shows '????' instead of normal characters.

Please help.

mvbl fst
  • 5,213
  • 8
  • 42
  • 59
  • not sure about this but did you check whether the browser has the encoding installed already? – Michael Mao Aug 05 '10 at 22:26
  • Sure you don't have a browser problem? The text at that link renders correctly here, and the document is being correctly detected as UTF-8. – John Flatness Aug 06 '10 at 01:43
  • possible duplicate of [UTF-8 all the way through...](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – deceze Aug 06 '10 at 01:46
  • @zerocrates, it wasn't browser, I sure tried that. I added SET NAMES and SET CHARACTER_SET to utf8 and it worked. – mvbl fst Aug 18 '10 at 16:09

3 Answers3

4

try to execute the following query before loading your data

SET NAMES 'utf8';
Andreas Linden
  • 12,489
  • 7
  • 51
  • 67
1

Have you also tried:

set character_set_connection=utf8;
mvds
  • 45,755
  • 8
  • 102
  • 111
0

You didn't mention the font you're using, but it's a big factor. Not all fonts contain all character sets.

bcosca
  • 17,371
  • 5
  • 40
  • 51
  • Font didn't matter. All I end up doing was converting tables to UTF-8 and adding mysql_query ("SET NAMES utf8"); mysql_query ("SET CHARACTER_SET utf8"); to MySQL connect code in PHP – mvbl fst Aug 18 '10 at 16:06