MySQL Forums
Forum List  »  Newbie

Insert unicode data to MySQL
Posted by: lam yue
Date: November 16, 2004 02:08AM

Hi, my database, tables and columns are in UTF-8 encoding, I can insert / display unicode data correctly by using JSP pages. However I can't insert unicode data by an direct insert statement or any MySQL client (MySQL cc, Query Browser etc ...)
I want to insert this character '日' which the unicode HEX value is 0xE697A5

when I type '日' using Query browser, I got a "?" when I select it afterward, the HEX value becomes 0xC3A6E28094C2A5, which I don't think it is the correct value

then I type:
insert into tables set name = 0xE697A5

then the HEX value is correct, I can see the corrrect character in Query browser and all my JSP

So how can I insert some Unicode character from Query browser or by direct insert statement like this:
Insert into tables set name = '日'

(WITHOUT typeing the exact HEX value of required unicode character)

I have try setting the client, server, connection, results variable to UTF8 and still no luck

my MySQL is 4.1.1 and JDBC is 2.5

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Insert unicode data to MySQL
November 16, 2004 02:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.