Chinese character problem

Chinese character problem

am 24.06.2002 09:38:27 von henry lee

Dear professional people,

When I write a program to store the (Big5) Chinese characters ¯S³\¸gÀç
into mysql database through the mysql ODBC driver,
the original chinese characters change into another characters ¯S³¸gÀç
in mysql database.

On the other hand, I have tried the program to store the (Big5) Chinese
characters into another database through another ODBC driver, it is correct.
The chinese characters remain the same.

Would you help me to solve the problem?


How-To-Repeat:

1. Create a table (named TestTb) in mysql database with the following fields
:
Field RecNum
Type INT
Length 4
Not Null
Extra auto_increment

Field DataField
Type CHAR
Length 20

2. Create mysql ODBC (named TESTODBC) which points to the database having
the above table.

3. Create an ASP program as follows:

<%@ Language=VBScript %>

<%
set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "DSN=TESTODBC;UID=root;Password=;"
FieldContent = "¯S³\¸gÀç"
response.write "Input =" & FieldContent & "
"
sql = "insert into TestTb (DataField) values ('" & FieldContent & "')"
oConn.execute(sql)

sql = "select * from TestTb"
set oRs = oConn.execute(sql)
do while not oRs.EOF
response.write "RecNum=" & oRs("RecNum") & "
"
response.write "DataField=" & oRs("DataField") & "
"
oRs.movenext
loop
%>

4. run the ASP program to see the special result.


My contact email address is henrylee_hk@hotmail.com

Thanks for help!

Best regards,
Henry.


____________________________________________________________ _____
Send and receive Hotmail on your mobile device: http://mobile.msn.com


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12133@lists.mysql.com
To unsubscribe, e-mail

Chinese character problem

am 24.06.2002 13:30:44 von Michael Widenius

Hi!

>>>>> "henry" == henry lee writes:

henry> Dear professional people,
henry> When I write a program to store the (Big5) Chinese characters=
=AFS=B3\=B8gÀç
henry> into mysql database through the mysql ODBC driver,
henry> the original chinese characters change into another characters =AF=
S³¸gÀç
henry> in mysql database.

What command did you use for storing data ?

If you did this with an INSERT SQL statement, you have to escape the \
ESCAPE character.

This should however work if you are using prepared statements, as in
this case the MyODBC driver will handle the escaping of your data.

Have you started the mysqld server with --default-character-set=3Dbig5 =
?

Regards,
Monty

--=20
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Michael Widenius
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com



------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12138@lists.mysql.com
To unsubscribe, e-mail