469,939 Members | 2,378 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,939 developers. It's quick & easy.

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

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
Nov 17 '05 #1
1 2579
CYF wrote:
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
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Aditya Ivaturi | last post: by
2 posts views Thread by peter | last post: by
reply views Thread by Vikram Vaswani | last post: by
reply views Thread by Suki | last post: by
4 posts views Thread by hao | last post: by
1 post views Thread by franchdream | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.