I am reading a Serbian UTF8 file with fgetcsv
. While on linux
setlocale(LC_ALL,"sr_RS.UTF8")
does the trick, I couldn't get the characters to be loaded properly on Windows. Furthermore, when I try to save the string to the database, it saves only until first non-latin character (this could be related to the application though). My PhpStorm debugger also shows a question mark instead of the non-latin character. Whereas if I define a variable value inside PhpStorm to contain non-latin characters, it shows correctly.
String is displayed wrongly in both browser (Unicode encoding) and PhpStorm debugger. The variable with a Unicode value defined in the code shows correctly on browser/IDE output.
I tried setting headers and using utf8_encode
as suggested here, but it didn't work.
Thanks.