Double-byte character handling in database

L

Lau Lei Cheong

Hello,

I'm writing a project that involves entering chinese character into
MySQL database.

Since 1) connection-based coding selection requires an upgrade to
version 4.1.1 or above and my company don't want to do that, 2) the web
program will run in both big5 and gb2312 so I can't simply set the coding to
big5, and 3) my company's backend is written in VB6.0 which is they told me
do not support unicode(so I can't change the database's default coding to
Unicode), I have to seek method to deal with it in the coding.

For most of the time, it is OK to have the coding be latin1, which is
the default character coding for MySQL. However, when the lower byte of the
character is " ' "
or " " " the SQL server will mixup the data and the keywords in the SQL
statement, which would not be the case if I set proper character coding for
the SQL.

I've tried to use String.Replace() to replace " ' " with " \' " but
seems that the function won't recognize it at all.(This is normal as while
the program is running it's running in Unicode) Could anyone suggest other
ways to deal with it?

Thanks alot.

Regards,
Lau Lei Cheong
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top