My site does not display the Russian and Chinese language even if I add the header in my php page Header ('Content-Type: text / html; charset = utf-8');
Asked
Active
Viewed 45 times
-1
-
Show us some code please...... – JustBaron Feb 17 '17 at 10:12
-
EVERYTHING has to use the same character encoding. It's not enough to just send charset=utf8 in the header. Your PHP script needs to be saved in UTF8, all PHP files it depends on need to be saved in UTF8, all data files (if any) have to be saved as UTF8, all databases (if any) have to be using UTF8, the connection between the PHP script and the database has to be encoded in UTF8... – GordonM Feb 17 '17 at 10:17
-
'SET NAMES utf8'); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $conn; } – douaa Feb 17 '17 at 10:18
1 Answers
0
What you mean "not displaying"? Bad encoding or something else? Try to use:
setlocale(LC_ALL, 'UTF-8');

edwardstock
- 168
- 2
- 10
-
-
That means you have not "utf-8" encoded data. Check your data in DB or where you get data. Also check php file encoding. If you want to see what encoding in strings, use http://php.net/manual/en/function.mb-detect-encoding.php – edwardstock Feb 17 '17 at 10:27