Okay, I tried the SELECT IF idea, but the results are a little ambiguous. Here is what 
I typed:

        SELECT IF(networkname=<chinese-char>, 1, 0) from networktable;

where networkname is a varchar column, and networktable is my table. The result of 
this query is 1, which means it matched. However, the header for the result column is 
labeled "IF(networkname="?", 1, 0)". So I can interpret the result of the operation 
two ways: 1) the character was stored correctly and the chinese char in my query 
matched the chinese char in the db, or 2) the char was stored incorrectly as a '?', 
and the char in my query was converted to '?' before the query was executed, in which 
case the '?' in my query would match the '?' stored in the db. Either case would 
return 1.

Tricky...

S Lopes


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


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