I also have an MFC app which reads data from this table, and displays it as '?'. Using 
the debugger and its watch pane, I can see the app is reading '?' from the db. The app 
handles strings in Chinese without problems elsewhere in the code, this issue only 
comes up when reading from the db.

S Lopes



-----Original Message-----
From: James Huang [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 10:18 AM
To: [EMAIL PROTECTED]; Silvio Lopes de Oliveira;
[EMAIL PROTECTED]
Subject: RE: Unicode characters become question marks


Victor,

I'm positive the database is storing ?'s. You may test with these steps:

1) insert "\u7247\u4EEE\u540D" into a UTF8 table;
2) Query and get it back into string s;
3) for each char c in s: System.out.println((int)c);

Thanks,
-James

>From: Victor Pendleton <[EMAIL PROTECTED]>
>To: 'Silvio Lopes de Oliveira ' <[EMAIL PROTECTED]>,Victor Pendleton 
><[EMAIL PROTECTED]>,'James Huang ' 
><[EMAIL PROTECTED]>,"'[EMAIL PROTECTED] '" <[EMAIL PROTECTED]>
>Subject: RE: Unicode characters become question marks
>Date: Wed, 2 Jun 2004 12:09:02 -0500
>
>If you can type the character into the keyboard try this.
>SELECT IF(col1=<chinese-character>, 1, 0)
>
>Else try this from a java program
>if (rset.getString(col1).equals(<chinese-character>))
>{
>System.out.println("match");
>}
>else
>{System.out.println("invalid");
>}
>
>-----Original Message-----
>From: Silvio Lopes de Oliveira
>To: Victor Pendleton; James Huang ; [EMAIL PROTECTED]
>Sent: 6/2/04 11:59 AM
>Subject: RE: Unicode characters become question marks
>
>Yes, my display can handle the Chinese characters. I have also changed
>the application font of MySQL Control Center to SimSun, which supports
>all the Chinese characters I am using. When I type the characters in
>MySQL Control Center, I see the Chinese characters. I edit a varchar
>field in an existing record, I type the Chinese content, hit enter, save
>the table, and I still see the Chinese characters. When I requery the
>table, the Chinese characters have become question marks.
>
>As for verifying whether the correct Unicode is being stored, how do I
>do that? All I can see once I requery are the question marks. I don't
>know whether the Unicode is being stored as question marks, or whether
>it is stored correctly and is getting converted to question marks when
>the stored data is retrieved.
>
>S Lopes
>
>
>
>-----Original Message-----
>From: Victor Pendleton [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 02, 2004 9:51 AM
>To: 'James Huang '; Silvio Lopes de Oliveira; '[EMAIL PROTECTED] '
>Subject: RE: Unicode characters become question marks
>
>
>Can you display properly handle the Chinese characters? I would try to
>verify that the correct unicode code is being stored.
>
>
>-----Original Message-----
>From: James Huang
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Sent: 6/2/04 11:45 AM
>Subject: RE: Unicode characters become question marks
>
>I saw the same problem with 5.0 alpha and Java/JDBC. The text was
>Chinese
>characters in Java; the tables were created with default character set
>UTF8.
>Seems only questions marks are stored.
>
>Wondering if far-east characters in UTF8 are support by MySQL's UTF8
>support?
>
>-James
>
> >From: "Silvio Lopes de Oliveira" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Subject: Unicode characters become question marks
> >Date: Wed, 2 Jun 2004 09:39:14 -0700
> >
> >MySQL Server: 4.1.1 alpha
> >MySQL Control Center: 0.9.4 beta
> >
> >I am not sure whether this is a Control Center or MySQL Server problem,
>but
> >here it goes:
> >
> >I have a database with MyISAM tables created using character set UTF-8.
>I
> >have installed support for Chinese on my machine, and using MySQL
>Control
> >Center I entered some values in Chinese for some varchar fields. I had
>also
> >changed the app font for Control Center to SimSun, which supports
>Chinese
> >characters. When I requery the table, the Chinese characters have been
> >changed to question marks. I expected, of course, that the Chinese
> >characters would be displayed.
> >
> >I tried this to access the data programatically (using an MFC app and
>ODBC
> >Connector) and it also shows question marks. I'm not sure whether the
> >conversion to question marks occurs when the data is stored into the
>table,
> >or when the data is retrieved.
> >
> >I found the following discussion thread debating what seems to be a
>similar
> >issue, but it was not clear whether to me they ever determined a
>solution
> >or if it is a bug:
> >
> >   http://lists.mysql.com/mysql/164067
> >
> >Here are the values for my character set variables:
> >
> >+--------------------------+--------------------------+
> >| Variable_name            | Value                    |
> >+--------------------------+--------------------------+
> >| character_set_server     | utf8                     |
> >| character_set_system     | utf8                     |
> >| character_set_database   | utf8                     |
> >| character_set_client     | utf8                     |
> >| character_set_connection | utf8                     |
> >| character-sets-dir       | C:\mysql\share\charsets/ |
> >| character_set_results    | utf8                     |
> >+--------------------------+--------------------------+
> >
> >I am starting the MySQL server as follows:
> >
> >   mysqld --default-character-set=utf8
> >
> >I need to see the Chinese characters both in Control Center and my MFC
>app
> >which uses ODBC Connector.
> >
> >Thanks,
> >S Lopes
> >
> >
> >--
> >MySQL General Mailing List
> >For list archives: http://lists.mysql.com/mysql
> >To unsubscribe:
> >http://lists.mysql.com/[EMAIL PROTECTED]
> >
>
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:
>http://lists.mysql.com/[EMAIL PROTECTED]



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

Reply via email to