Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Chinese Text Displaying As ?

forums forums SQLyog Using SQLyog Chinese Text Displaying As ?

  • This topic is empty.
Viewing 8 reply threads
  • Author
    Posts
    • #11865
      khwaja
      Member

      HI

      I created a table name login first_name varchar(64) charset=UTF8 collation=utf8_general_ci and last_name varchar(64) with same charset and collation.

      Now when iam inserting values like INSERT INTO login (first_name,last_name)VALUES('海峽定義','chinese'). Its working fine..

      But when iam inserting the same chinese text from the textbox in winforms (c#) its displaying as ????? in table

      Here iam using : mysqlserver version : 5.1.25-rc-community

      sqlyog : v 8.1

      connection string:

      MySQLCon = new MySQLConnection(MySQLConString.AsString + “;charset=utf8”);

      Iam using mysqldriver.cs as a connector

      show variables like 'char%'

      character_set_client –> utf8

      character_set_connection –> utf8

      character_set_database –> utf8

      character_set_filesystem –> binary

      character_set_results –> utf8

      character_set_server –> utf8

      character_set_system –> utf8

      character_set_dir –> C:Program FilesMySQLMySQL Server

      5.1sharecharsets

      SHOW VARIABLES LIKE 'col%'

      collation_connection –> utf8_general_ci

      collation_server –> utf8_general_ci

      collation_database –> utf8_general_ci

      can u please help me to fix this problem

      I also tried with big5,ucs2,and gbk also.

    • #30459
      peterlaursen
      Participant

      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;
    • #30460
      khwaja
      Member
      '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;

    • #30461
      peterlaursen
      Participant

      You did not really reply to any question!  :huh:

    • #30462
      khwaja
      Member

      Hi.

      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

    • #30463
      peterlaursen
      Participant

      How do you connect to MySQL? Are you using ODBC or Connector.NET?

    • #30464
      peterlaursen
      Participant

      I can see that you have already posted heretoo:

      http://bugs.mysql.com/bug.php?id=50868

      basically this is the right place. We do not use C# in combination with MySQL so we do not have a ready reply to this.

    • #30465
      peterlaursen
      Participant

      Looks like you got a friend!  😆

      http://bugs.mysql.com/bug.php?id=50933

    • #30466
      khwaja
      Member

      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

Viewing 8 reply threads
  • You must be logged in to reply to this topic.