Language problems and solutions
Update: Toggling the collation in the settings for the whole database, in for instance PhpMyAdmin has been known to solve quite a few problems.
So you have encoded all your language files with UTF-8 encoding and set all possible language options in the MySQL server to UTF-8. You have tried all possible combinations of utf8_decode(), utf8_encode() and iconv() and it still doesn’t work? That Ü stills shows up as some garbled crap or a question mark?
I’ve had this problem now on two occasions. The first time was in a project using AMFPHP, special German characters were garbled despite correct settings in the database and in AMFPHP. I uploaded to the German sever so the Germans could take a look at the problem too and the problem was gone. The latest issue was with language files for VirtueMart in Joomla 1.0.13. No matter how many encoding/decoding combinations I tried on these language files and their output I couldn’t get special German characters to work.
You guessed it, uploading the whole project to the German Suse 9.3 server solved the problem. This time I really wanted to get to the bottom of the problem so I checked the output from phpinfo() but I couldn’t find any significant differences there between the German server and the Thai server. The issue must lie deeper. Maybe it’s got something to do with the default language and locale that are chosen during the Linux install process? Maybe it’s something else, something that can be changed without having to change the server locale?
All our projects are multilingual and all the ones we do 100% ourselves without using external libraries or projects work just fine on the Thai server with both German, Russian and Thai. Using one of the above encoding-decoding functions always solves our problems. Hence, the root of the problem can not only be in the server software.
If you are able to shed some light on the issue, please be so kind and take some time to comment. I’ve searched and looked but I haven’t been able to find any good explanations. And of course, my Linux admin won’t help me.
Related Posts
Tags: language settings, Linux, PHP