Saturday, 24 June 2017

mysql - PHP encoding issue



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.


Answer



try to execute the following query before loading your data



SET NAMES 'utf8';

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...