Chinese Garbled

devfzly posted 4 years ago in General
hi, i have some question. mysql server version is 5.1.54, database character set use "latin1", field's text encoding is 'gbk', i use heidisql connect to server, then show how Chinese Garbled, how can i setting in heidisql that it show normal?
Thank you a lot.

if i set text encoding is 'gbk' in connect setting, it show Chinese normal in a similar tool(call "Navicat for MySQL")
ansgar posted 4 years ago
HeidiSQL strictly uses UTF-8 for communicating with servers. There is no option in the connection to change that. If it's garbled, then we probably need UTF-16 here, or? I guess not all Chinese chars fit into the UTF-8 charset, do they?
devfzly posted 4 years ago
If I query a data, MySQL Server return results, and i find results's text encoding is 'utf8' in HeidiSQL. I mean whether to show results with a specific code, Such as 'gbk'.
ansgar posted 4 years ago
UTf-8 should contain all characters present in gbk. Same with other encodings like latin1. They're all displayed fine with utf-8 in heidisql. I'm just not sure if we probably need utf-16 for gbk displaying.
ansgar posted 4 years ago
As what Wikipedia says, GBK is displayable in UTF-8. So, I guess your data is stored in a different charset than your fields say.

Watch out for the charset of your table and - if different - the charset of your fields. Post that here please.
ansgar posted 4 years ago
You can simply go to Heidi's "Table" tab, then click "Create code", and copy the contents from there and paste them here.
kalvaro posted 4 years ago
The UTF-8 support in MySQL has its quirks (as in most other platforms and languages) but it should be able to hold Chinese characters just fine. Only exotic chars in the highest planes like
kalvaro posted 4 years ago

The forum has stripped out 95% of my post! Everything after an attempt to print a high-plane Unicode character!!!
kalvaro posted 4 years ago
Sorry but I don't feel like re-typing everything. Here's my test code:

as_default VARCHAR(50),
as_utf8 VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci,
as_gbk VARCHAR(50) CHARACTER SET gbk COLLATE gbk_chinese_ci,
PRIMARY KEY (foo_id)
ENGINE=InnoDB CHARACTER SET latin1 COLLATE latin1_general_ci;
INSERT INTO foo (as_default, as_utf8, as_gbk) VALUES ('仙俳反窃生地回火金拠況輸。', '仙俳反窃生地回火金拠況輸。', '仙俳反窃生地回火金拠況輸。');
FROM foo;

I cannot reproduce the issue.
kalvaro posted 4 years ago
Related: http://code.google.com/p/heidisql/issues/detail?id=3524
devfzly posted 4 years ago
Excuse me for my stupid.
thank you a lot.
Good life of peace.

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