If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Chinese characters showing as question marks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-08, 05:47
kabuki kabuki is offline
Registered User
 
Join Date: Mar 2007
Location: Bedfordshire, UK
Posts: 64
Chinese characters showing as question marks

I'm reasonably au fait with Access, but MySql is a mystery to me, so I'm not even sure I'm asking the right questions here!
A friend of mine runs an art website and sells artworks on it. She is French, living in the UK, but a lot of her client base is in China. Because of this, the MySQL database which sits behind the website was set up by some Chinese students which her partner found somewhere (not sure how this came about, to be honest!) Anyway, her problem is that the English language part of the system works fine, but on the Chinese part any names and addresses entered using Chinese characters end up as question marks in the database. I gather the said Chinese students aren't able to solve this issue. She has asked my advice as she knows I work with databases, but beyond my initial thought that it's something to do with the possibility that Chinese fonts are not being supported in MySQL, I'm not sure where to go next.
Any suggestions or advice would be gladly received! Thanks.
Reply With Quote
  #2 (permalink)  
Old 02-04-08, 06:09
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
check the character set of the database, the website.
make sure that both can support the Chinese character sets and any other languages
Reply With Quote
  #3 (permalink)  
Old 02-04-08, 06:22
kabuki kabuki is offline
Registered User
 
Join Date: Mar 2007
Location: Bedfordshire, UK
Posts: 64
Quote:
Originally Posted by healdem
check the character set of the database, the website.
make sure that both can support the Chinese character sets and any other languages
OK - I'll see if I can find that out, thanks.
Reply With Quote
  #4 (permalink)  
Old 02-06-08, 05:03
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
I believe charsets might well be your answer. The default for most installed versions of mySQL is to have charset latin1 and collation latin1_general_ci . Basically meaning any characters outside the normal latin1 get truncated. So you're going to have a problem in that chinese characters that have ALREADY been inserted into the database cannot be converted back out (because of the truncation). I believe the charset you'll need is binary (or UTF-8 anyone?). This will maintain the exact digit that represents the characters they're using. Then the next step is to use the right charset when you output in the browser. This will depend on the particular language orientation of the user.
Reply With Quote
  #5 (permalink)  
Old 02-06-08, 08:55
kabuki kabuki is offline
Registered User
 
Join Date: Mar 2007
Location: Bedfordshire, UK
Posts: 64
Thanks aschk, you're spot on. Problem solved!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On