Re: Chinese Charset is displayed as '????'
Posted by: Sourjya Sen
Date: April 06, 2005 09:10AM

You got to keep a few points in mind.

1. The respective columns in MySQL should be defined to hold UTF-8 or whatever character set you're using with a suitable collation. I'm using MySQL to store Thai language in a certain table - so my charset for this table/column is "tis620" and collation is "tis620_thai_ci"

2. The VB.NET Connection string should contain the the word "CHARSET=utf8" in order to enable VB to send in the characters with proper encoding to MySQL. An example statement in VB would be:
===============================================
ConnectionString = "SERVER=10.19.168.100;PORT=3306;DATABASE=somedb;User Id=someuser; PASSWORD=somepass;CHARSET=utf8"

Notice the usage of the CHARSET=uf8 --> THIS IS A MUST !!

These two steps were enough to let me store Thai in MySQL - and I believe its not different for Chinese at all.

3. If you're trying to view your database using the MySQL Command Line Client - then, your DB will ALWAYS SHOW UP WITH "??????????????" FIELDS. There's no way to avoid this - as the command line console is incapable of displaying UTF-8 characters yet. One of you replied that you can view it perfectly through phpMyAdmin - and that's how you SHOULD view the data. It's impossible to display it correctly unless it's viewed through a GUI supporting UTF Charsets.

Another alternative for you guys is to download and install the MySQL Query Browser from this site - that'll help you view your DB in proper format. One word of advice - use the command line tool for database creation/manipulation tasks - and for TESTING how different combinations of your queries react. I find it a lot faster this way. But viewing DB Contents should always be done through a GUI.

All the best with your venture. Believe me - it's NOT at all as frustrating it might seem.. follow step 1 & 2 and you'd have it in no time. Even I was amazed at the simplicity of the whole task once I got it done. :)

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


Subject
Views
Written By
Posted
Re: Chinese Charset is displayed as '????'
6249
April 06, 2005 09:10AM
3891
November 03, 2005 01:55AM
19258
January 18, 2007 09:47PM
5249
October 24, 2005 11:41PM


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.