I am developing a web site and my website needs to show some special characters like čćšđž. I use utf-8 charset and it's work but not in every situation. It's a little bit complicated, but I will try to explain it. So my website works in a following way. My website has some unchanging parts like header, menu, advertisements etc. and has the changing part, which is always attached to the main php file (include 'content.php'). Content.php gets some datas from txt file (so uses file operations like fopen, fread etc.) and some characters of this datas are showed incorrectly. But if I change the Encoding of my browser to Central European(Windows), this datas gotten from txt file are showed correctly, but the another parts of my website are showed incorrectly.
Can somebody tell me how to fix my problem?
Thank you!
Multilanguage problems!
Moderator: General Moderators
If you're just echo'ing the data from the text files then I'd suggest that the data in them has been encoded incorrectly. The best way to find out (I reckon) is to download SC Unipad (http://www.unipad.org/main/) and open the files in that. It's shareware, but it works for just checking things.
Alternatively, if you're doing anything with the data, make sure you're using the multibyte string functions rather than the ordinary ones: http://uk2.php.net/manual/en/ref.mbstring.php
Alternatively, if you're doing anything with the data, make sure you're using the multibyte string functions rather than the ordinary ones: http://uk2.php.net/manual/en/ref.mbstring.php
Also, you may want to try different encodings. My website has both English and German characters (including the ae, oe, ue characters), and ended up having to sift through about a hundred encodings to find the right one.
http://www.iana.org/assignments/character-sets <- Click this link, and search for the correct encoding for your character set. Make sure you copy the text to the right of the first "alias" listing. Hope this helps ^_^.
http://www.iana.org/assignments/character-sets <- Click this link, and search for the correct encoding for your character set. Make sure you copy the text to the right of the first "alias" listing. Hope this helps ^_^.