Forum Moderators: coopster

Message Too Old, No Replies

Chinese characters in PHP / MySQL

How to replace a bunch of?...

         

ph_eze_nouz

6:22 pm on Apr 10, 2004 (gmt 0)

10+ Year Member



Hi,

I am working on a new version on a site in Chinese. I tried to enter directly the characters into a MySQL database, but I cannot retrieve the content properly, I have lots of strange characters even if I use <meta http-equiv="content-type" content="text/html; charset=UTF-8">

So, I tried a very simple test: a page in PHP displaying the content of a variable passed in the URL. With ASCII characters, no problems, but with Chinese ones, I have a bunch of?

Does anybody can tell me how to use these characters in PHP / MySQL?

Many thanks for your help ;)

futuresky

7:12 pm on Apr 10, 2004 (gmt 0)

10+ Year Member



Just an idea and no guarantee it'll do what you need as I've not tried it, but would htmlentities work? It may be worthwhile looking into html_entity_decode() (ie the reverse of htmlentities) as well.

ph_eze_nouz

10:22 pm on Apr 10, 2004 (gmt 0)

10+ Year Member



Hi,

I have done another test which basically solved my problem ;) I created a first page with used the following specification:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

I add a link with Chinese characters passed in the URL. A second page, also using the UTF-8, then read properly these characters from the URL ;)

I hope this could help other people learning more on this topic ;)

All the best

ergophobe

3:58 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may find the following threads on character encoding useful

[webmasterworld.com...]

[webmasterworld.com...]

(see especially the link to Scott Reynen's article in the second thread, since he is dealing with Japanese chars and similar problems).

Tom