Jump to content

Thai characterset displayed as questionmarks


el_mariachi

Recommended Posts

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?

 

 

 

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.