Yet another UTF-8 problem.
| User, date | Message |
|---|---|
|
Written by wildcard
3 years ago Category: General 4 posts since Tue, 17 Apr 07 |
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'. |
|
Written by wildcard
3 years ago 4 posts since Tue, 17 Apr 07 |
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. |
|
Written by wildcard
3 years ago 4 posts since Tue, 17 Apr 07 |
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. |
|
Written by ansgar
3 years ago 3958 posts since Fri, 07 Apr 06 |
Great to get an update, even before I tried to dive into that - thanks! |
|
Please login to leave a reply, or register at first. |