473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 2832
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Aditya Ivaturi | last post by:
We have a CMS which is written is based on php & mysql. Recently we received a request to support multiple languages so that sites in that particular laguage can be created. I did some search on...
2
by: peter | last post by:
I am trying to truncate some Chinese Text returned from MySQL. If I use the substr function, then the last one or two chinese words would appear as symbols as opposed to the word it should be...
4
by: Ka | last post by:
I install a mysql server in default installation with latin charset, but I want to use GBK(a chinese charset), so that I can store and search chinese words directly. so, I download, unpack and...
0
by: Vikram Vaswani | last post by:
Hello all. I am working with MySQL 4.0. I have a requirement to create a data-driven Web page to display Chinese text from a MySQL table. I'm completely new to this, can someone tell me exactly...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
0
by: boonkit | last post by:
Currently i store the chinese character in unicode decimal format (&#<number>;). In this way, I can display and search the chinese character correctly. However, this will take more storage space....
0
by: Suki | last post by:
Hi, I am trying to write a C# windows application. this application have one textbox (with chinese word by default) and one button. This button will connect to mySQL and retrieve one record (in...
4
by: hao | last post by:
Hi, all When I use ASP to insert an record to a database, I got some errors and can not insert any value with Chinese Char. The only way I can do that is use "rst1.Addnew...rst1.update". Anyone...
1
by: franchdream | last post by:
IntPtr pBytes; Int32 dwCount; dwCount = szString.Length; pBytes = Marshal.StringToCoTaskMemAnsi(szString); string yang = Marshal.PtrToStringAnsi(pBytes); ........ WritePrinter(hPrinter, pBytes,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.