c# + Mysql chinese "?????"

C

CYF

My Computer :
Window XP Pro English Version -> I have set the "Regional" to
"Taiwan"
Mysql 4.1.x -- > set to big5 already

i am using C# to program.
When i retrieve chinese character from the mysql database, the chinese
character will become "????".
Alternatively, when i insert the chinese character from the program to
the database, those chinese character will become symbols too.
I have tested that i can insert chinese character to the database from
the "Mysql Control Center" ...

I have found some resources about this issue from the internet. I have
followed attempting to find out the solution such as setting the
"regional setting" from the Control panel.

I don't know what is the problem actually. Is it the matter of MDAC?
or I should use a chinese window to develop those programs that
involve chinese characters.

Can anyone show me the way or give me some cues ?
Any help will be appreciated ~ Thx
 
M

MuZZy

CYF said:
My Computer :
Window XP Pro English Version -> I have set the "Regional" to
"Taiwan"
Mysql 4.1.x -- > set to big5 already

i am using C# to program.
When i retrieve chinese character from the mysql database, the chinese
character will become "????".
Alternatively, when i insert the chinese character from the program to
the database, those chinese character will become symbols too.
I have tested that i can insert chinese character to the database from
the "Mysql Control Center" ...

I have found some resources about this issue from the internet. I have
followed attempting to find out the solution such as setting the
"regional setting" from the Control panel.

I don't know what is the problem actually. Is it the matter of MDAC?
or I should use a chinese window to develop those programs that
involve chinese characters.

Can anyone show me the way or give me some cues ?
Any help will be appreciated ~ Thx

In MSSQL you need to add 'U'in front of a string to insert it as unicode, like this:

UPDATE table SET name = U'Andy' where name = 'Andrey'

Imagine that instead of Andy it's something in a non-ascii font.
I'm sure that MySQL has something similar.

Also, when you create a table in MySQL you should specify character_set = utf8 - that's unicode

Hope it helps
Andrey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top