Yet another UTF-8 problem.

wildcard posted 7 years ago in General
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:

"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'.
wildcard posted 7 years ago
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.
wildcard posted 7 years ago
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 posted 7 years ago
Great to get an update, even before I tried to dive into that - thanks!
www-adpog-com posted 4 years ago
Hmm...I still have some utf-8 problem. with Japanese...
地域包括ケアクラウドサービス「メディカルケアステーション」の is displayed as square symbols
ansgar posted 4 years ago
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.
www-adpog-com posted 4 years ago
It works with "MicroSoft YaHei" or any of the fonts starting with @
ansgar posted 4 years ago
Glad to hear that!

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