Bug #9214 Program does not display non-english characters properly
Submitted: 16 Mar 2005 6:41 Modified: 17 Mar 2005 4:09
Reporter: Albert Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.6 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[16 Mar 2005 6:41] Albert
Description:
When making query on a DB containing cyrillic characters in cp1251 encoding - in the results window cyrillic characters are not displayed properly.

Executing 'SHOW variables like '%char%' query gives the following results:

------------------
'character_set_client', 'utf8'
'character_set_connection', 'utf8'
'character_set_database', 'cp1251'
'character_set_results', 'utf8'
'character_set_server', 'cp1251'
'character_set_system', 'utf8'
'character_sets_dir', 'C:/Program Files/MySQL/MySQL Server 4.1/share/charsets/'
------------------

Any attempts to change the client's, connection's or results' character sets are not successful. I tried to execute in the browser's window queries like this:

SET GLOBAL character_set_client = 'cp1251'
SET character_set_client = 'cp1251'
SET NAMES 'cp1251'

but all these queries do not make any changes in the client's character set, though they do not produce any error messages. Moreover, when I tried to execute 

SET GLOBAL character_set_client = 'latin1'

this also had not change the client's character set. It always remains 'utf8'.

I for several hours have been seraching internet and newsgroups and saw quite a few people reporting problem like this, but I had not seen any viable answer how to fix that problem.

How to repeat:
Try to display query results with fields containnig cyrillic letters from cp1251 database.

Suggested fix:
To add or to make more clear supporting non-english character sets in the application.
[16 Mar 2005 10:10] Albert
I continue my research on this problem and discovered in earlier bug reports that the UTF8 charset cannot be changed in the client at all and this behaviour is by design. Therefore I guess that the cause of the problem is either in the improper fonts used by MySQL Query Browser for displaying cyrillic characters or in the settings or mappings of charsets. It should be noted that I'm using the fresh Windows and MySQL installations and did not "tweak" any charset settings at all.
[16 Mar 2005 12:05] Albert
By investigating problem even further I found the cause of the problem and some palliative solution. The problem seems in that the program inmproperly uses fonts for displaying cyrillic letters. I tried in the settings of MySQL Query Browser all the fonts installed on my machine and had not achieved any positive results. Then I installed a program which has its own font for displaying cyrillic letters in cp1251 encoding and tried to set this font as "Data Font" in MySQL Query Browser and all characters become displayed OK. 

Probably for correctly displaying cyrillic eltters your program needs some additional fonts on a fresh Windows installation.
[16 Mar 2005 12:40] Alex Fedosow
Hi, Albert!
Can you give me a link on this font ?
[16 Mar 2005 21:28] Albert
Hi Alex,

this is a totally free program called Starling, you can download it from here 

http://starling.rinet.ru/download.htm

file "star4win.exe". After installing it, the font can be found in the program's installation directory in the "fonts" folder, filename of font file is "luconstr.ttf" (Lucida Consol Star). Or I can send you the font file by email (99 KB).

More details on the problem. Most fonts on my machine, such as Arial, in the cp1251 encoding give the following representation of russian word "абзац" ("abzac"):

"àáçàö" ("aacao" where all letters have various fonetic marks).

Others, such as MS Sans Serif, simply display black rectangles instead of all letters.

When I select in MySQL QB a field containing cyrillic letters and view it in the popup editor, the cyrillic letter 'a' has a hex value C3 in the binary editor. When I copy the content of this field and past it anywhere outside MySQL, this letter has the value EO (i.e. the correct value which this letter has in the cp1251 encoding).
[17 Mar 2005 4:05] Jorge del Conde
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[17 Mar 2005 4:09] Jorge del Conde
This is not a bug.  The behaviour you're experiencing is expected when you use MySQL Query Browser because each time you execute a query, a new connection to mysql is opened.  To fix this, you must execute your queries in the script mode and not in the top query box.
[1 Jul 2008 17:28] John Larsen
Not a bug? How about we call it a feature request then. There is no convenient way to set character sets in MySQL Query Browser while other SQL query programs do this semi automatically.