MySQL Forums
Forum List  »  PHP

Thai characters getting converted to '????' while reading from MySQL DB
Posted by: Sourjya Sen
Date: October 02, 2007 12:56AM

I've this MySQL Db that has been declared with default charset as UTF-8. Even the tables are collated with the same. I store a mix of English and Thai text in some of the fields. The problem occurs while displaying the data as a page generated by PHP. All instances of Thai text gets converted to the ubiquitous '????'.

I remember having the same problem with .NET too - but there you could pass on a parameter in the Connection String to indicate UTF Encoded data and the text would display fine.

How do I do the same with PHP i.e. how do I display the Thai text properly?

P.S. The PHP generated pages all contain a "charset=UTF-8;" part in the Content-Type header. So it shouldn't logically be a problem with the page encoding.

...the average population of all the planets in the Universe can be said to be zero. From this it follows that the population of the whole Universe is also zero, and that any people you may meet from time to time are merely products of a deranged imagination.

Options: ReplyQuote

Written By
Thai characters getting converted to '????' while reading from MySQL DB
October 02, 2007 12:56AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.