Hello.


Look at output produced by:

  show variables like '%char%';

and 

  show create table 'your_unicode_table';



If you use Unicode, the most obvious that all charsets should be the same.

But if you see something else, probably  you should correct that.

More you may read at:

  http://dev.mysql.com/doc/mysql/en/Charset.html





Koon Yue Lam <[EMAIL PROTECTED]> wrote:

> Hi, I am using MySQL 4.1.1 and all databases, columns are set to UTF-8 enco=

> ding

> 

> I have try both MySQL cc and Query browser and try to enter some

> Chinese character, but when I print out the HEX value of the

> character. It isn't in Unicode that I expected, but i can't see those

> Chinese character using the above clients

> 

> I can only insert correct Unicode character by using JSP page and a

> HTML form, encode all character in Unicode and send to database.

> However it is useless because I can't run some query directly to

> databse when the query contains Chinese character.

> 

> How can I run an insert query directly to database and the data would

> be stored in Unicode?

> 

> I have try prefix the character with character set and collation, and

> I got a warning :

> 

> insert into tables set name =3D _utf8'=E6=97=A5'

> code 1265: Data truncated for column 'name' at row 1

> 

> If the query becomes this:

> insert into building set name =3D convert('=E6=97=A5' using 'utf8')

> 

> I don't have warning and insert is OK, but the HEX is wrong

> 

> the Unicode of '=E6=97=A5' should be E697A5,=20

> but the above query insert a HEX value of 'C2A4C3A9'

> which I don't know what it is .......

> 

> The only method that I can insert an unicode character is by using

> their Unicode directly in a query:

> insert into building set name =3D 0xE697A5

> 

> then everything are fine except I can't read it from any clients, but

> JSP can display it correctly.

> 

> Anyone know what I am doing wrong?=20

> 

> Any help would be appreciated

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to