Forum Replies Created
-
AuthorPosts
-
khwajaMember
Hi Peter
Yeah i got a gud frnd 😀
I tried with two sample programs. One with odbc and other with .net connector.
I am facing the same problem.It still dispalying as ????.
I feel its a problem with winform but not with database.
Thanks
Khwaja
khwajaMemberHi.
Yeah when iam inserting the query like INSERT INTO details VALUES('海峽定義','chinese') from sqlyog its working fine.
But when coming to winfrom(c#) when iam using the same query, in table its dispalying as ????
SELECT HEX(first_name) FROM details :
海峽定義–> E38381E383A3E3838ABE5AAE9AE7BEA920 (INSERT FROM SQLYOG)
????–> 3F3F3F3F
and i also used the same charset for table and for server.
create table details:
CREATE TABLE `details` (
`first_name` varchar(32) DEFAULT NULL,
`last_name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
thanks
Khwaja
khwajaMember'peterlaursen' wrote on '04:well .. looks like a problem with Winforms and not SQLyog. I do not know how Winforms handles Chinese. There is no configuration option to make it use utf8?
My guess is that Winforms (being a Microsoft program) will use 'utf16 with little-endian byte-order' (also known as 'Windows Unicode') and not 'utf8' to represent Unicode (at least as default). MySQL does not support 'Windows Unicode'. It supports utf8 and ucs2 (what is *almost* the same as 'utf16 with big-endian byte-order'. You can easily identify it what is stored in the table, as in utf8 Chinese characters are 3 bytes long (whereas in utf16 (and also non-unicode Chinese character sets to my knowledge) they are 2 bytes long.
Please execute
Code:SHOW CREATE TABLE tablename;for the table you are inserting to. We need first to be sure that the table definition does not have another charset than server default.
Also please try to insert a small Chinese string from both SQLyog and Winforms (same string with both – and paste it here in clear text) and next execute
Code:SELECT HEX(columnname) FROM thetable; -
AuthorPosts