Yet another UTF-8 problem.

[expired user #2000]'s profile image [expired user #2000] posted 14 years ago in General Permalink
HeidiSQL doesn't display multibyte characters correctly.
It looks like HeidiSQL tries to display them as singlebyte characters. For example, the swedish character 'å' is displayed as 'Ã¥', the japanese character '機' is displayed as 'æ©Ÿ'.

My website displays the same multibyte characters correctly. (I'm using a "Content-Type: text/html; charset=UTF-8" header and utf-8 charset meta tag in the html.)
In HeidiSQL, i can use 'SET NAMES latin1' and then it shows the characters correctly. (I don't understand why though.)

Is this normal behaviour in HeidiSQL? Is there anything I can do to get around the problem?

Server variables:

"Variable_name";"Value"
"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"
"collation_connection";"utf8_general_ci"
"collation_database";"utf8_unicode_ci"
"collation_server";"utf8_unicode_ci"
"init_connect";"SET collation_connection = utf8_unicode_ci; SET NAMES utf8;"

My database has character set utf8, collation utf8_unicode_ci.
My tables are created with 'DEFAULT CHARSET=utf8'.
[expired user #2000]'s profile image [expired user #2000] posted 14 years ago Permalink
Whith PHP, I get these variables instead:

character_set_client latin1
character_set_connection latin1
character_set_database utf8
character_set_filesystem binary
character_set_results latin1
character_set_server utf8
character_set_system utf8
character_sets_dir c:\wamp\bin\mysql\mysql5.0.51a\share\charsets\
collation_connection latin1_swedish_ci
collation_database utf8_general_ci
collation_server utf8_unicode_ci
init_connect SET collation_connection = utf8_unicode_ci; SET NAMES utf8;

That can't be right.
[expired user #2000]'s profile image [expired user #2000] posted 14 years ago Permalink
Solved.
Was the result of a bad conversion from an old latin1 database and the wrong charset used in mysql connections from PHP.
A proper db conversion and the use of "SET NAMES utf8" in PHP did the trick.
ansgar's profile image ansgar posted 14 years ago Permalink
Great to get an update, even before I tried to dive into that - thanks!
[expired user #7302]'s profile image [expired user #7302] posted 11 years ago Permalink
Hmm...I still have some utf-8 problem. with Japanese...
smartphone
地域包括ケアクラウドサービス「メディカルケアステーション」の is displayed as square symbols
ansgar's profile image ansgar posted 11 years ago Permalink
That's mostly due to a font which is not capable of displaying Japanese characters. Try setting an appropriate font in Tools > Preferences > Data appearance.
[expired user #7302]'s profile image [expired user #7302] posted 11 years ago Permalink
It works with "MicroSoft YaHei" or any of the fonts starting with @
ansgar's profile image ansgar posted 11 years ago Permalink
Glad to hear that!

Please login to leave a reply, or register at first.