I am using php in order to read a .txt file which contains any kind of characters. When I use the php function, utf8_decode() characters such as éàêô... are correctly recognized but chinese characters are displayed as ????. And when I don't use utf8_decode() the echo output of a chinese character is something like 北京å. What is stranged is that on the source code of the generated webpage the chinese characters are corectly displayed.
How can I do to have a correct output ?
I use the fgets function to creat a variable $buffer to read into the .txt file and then :
$buffer = explode(" ", $buffer);
foreach($buffer as $word){
//$word=utf8_decode($word);
echo "$word \n";
}
Thank you very much