el_mariachi Posted March 31, 2008 Share Posted March 31, 2008 Hello, I'm having a bit of a trouble with a website who also supports Thai language. Thai static text is displayed correct, but all Thai text that is stored in the db is displayed like either questionmarks or plain junk. The funny thing is that on my local server with the exact same configuration I don't have that problem as long as I don't fool around with things like SET NAMES "utf8" or SET CHARACTER SET 'utf8'. The only thing what locally seems to work is SET NAMES 'latin1' but this is already set by default. On the remote server no matter what charset I set I get garbage or question marks. And on the same server with phpMyAdmin when I do a simple select statement the text is displayed correctly! (to make it even more confuzing) So the text is inserted correctly. Here is the create script: DROP TABLE IF EXISTS `chat`.`regions`; CREATE TABLE `chat`.`regions` ( `regionId` int(10) unsigned NOT NULL, `regionName` varchar(45) CHARACTER SET latin1 NOT NULL, `regionNameThai` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`regionId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; In the header information of each .html page I use: content="text/html; charset=utf8" I contacted my hosting provider about this but they forwarded it to level II support so I guess I'll have to wait a little while for that. Do you guys have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/98765-thai-characterset-displayed-as-questionmarks/ Share on other sites More sharing options...
aschk Posted March 31, 2008 Share Posted March 31, 2008 You may wish to check the version of MySQL that you are using as I believe column collations (charsets) only came in after a certain version revision. If you store your information in UTF8 you're likely to be able to store thai characters, however I cannot be certain of this. As long as you're using the correct meta header tag in your html there shouldn't be a problem rendering the content in a browser. I do recommend however checking that the server is sending the correct charset with the header information (you can debug this with firebug for firefox). Quote Link to comment https://forums.phpfreaks.com/topic/98765-thai-characterset-displayed-as-questionmarks/#findComment-505484 Share on other sites More sharing options...
el_mariachi Posted March 31, 2008 Author Share Posted March 31, 2008 The version is 5.045, which supports the column collation, the html the server gives back to me contains the correct headers. UTF8 can store anything, and like I said, when I do an sql-query with phpMyAdmin on the server I can see the Thai characters, so it must be ... it must be... I really don't have a clue ???. Here is the website address: http://www.soichat.com/login/changelanguage/lang/thai/ The thai characters are displayed correctly except those coming from the database, which are all question marks. here is another testpage which doesn't use anything else than an mysql_query http://www.soichat.com/public/test.php Quote Link to comment https://forums.phpfreaks.com/topic/98765-thai-characterset-displayed-as-questionmarks/#findComment-505568 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.