Bug #5362 National (cyrillic cp1251 i.e.) strings appears in wrong encoding
Submitted: 2 Sep 2004 4:39 Modified: 3 Nov 2004 12:32
Reporter: A B Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.0.7-beta OS:Windows (WinXP (SP1+))
Assigned to: Michael G. Zinner CPU Architecture:Any

[2 Sep 2004 4:39] A B
Description:
Server configured to use cp1251 as default codepage

| character_set                   | cp1251
| character_sets                  | latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 |
| language                        | C:\usr\sbin\mysql\share\english\

All national strings apears in wrong codepage and I cannot query strings with national symbols in WHERE clause (always return empty set and (in some situations) bug #5358).

How to repeat:
Just setup your server as described, and add some rows into test table
CREATE TABLE `i16bug` (
  `str` char(50) binary not null default ''
) Type=InnoDB;
[2 Sep 2004 10:25] Michael G. Zinner
Thanks for reporting. Could you check the character set of your "Default Database"? It has to be cp1251 as well.

What we do is, we use a SET CHARACTER SET utf8, since the GUI tools work with utf8 internally. Therefore, the server will convert the utf8 strings to the character set of the default database.

Please execute 
ALTER DATABASE yourdefaultdb CHARACTER SET cp1251 COLLATE cp1251_general_ci; 
for the database you specify in the "Schema" field in the connection dialog. Note that only the charset of the default database is used, even if you are working with several databases at the same time within QB.

Please also make sure that you use appropriate fonts that can display the cyrillic characters in utf8 encoding. These can be set up in the options. The best Data Font is Arial Unicode MS, since it is the only font that can display all ~30000 characters defined in Unicode. For the Code Font you could use Bitstream Cyberbit and adjust the Width paramter accordingly.

This is a very important issue, could you please report if you get your setup to work following the hints above. We will add it to the manual than.

Thanks a lot.
[2 Sep 2004 22:56] A B
Me sorry, but I use 4.0.20d server :(
When I try your proposed query, I catch the ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE combats CHARACTER SET cp1251 COLLATE cp1251_general_ci
[2 Sep 2004 23:18] A B
And, as I see, 4.0.* server doesn't support multi-byte charsets...
:(