dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.39k stars 657 forks source link

Using mycli sometimes Chinese gibber #725

Closed wangxingzhen closed 1 month ago

wangxingzhen commented 5 years ago

Only some tables are garbled, and the character set has been set to utf8mb4

Wistral commented 5 years ago

Me,too. All tables can work well in mysql, but part of them behave strange in mycli. My running env is mysql Ver 14.14 Distrib 5.7.17, for Win64 (x86_64) and mycli Version: 1.19.0

Some tests have been made as follows:

but if I just remove first column, the problem should disappear...

create table student(
    sname varchar(6),
    ssex varchar(1),
    sage int unsigned,
    sdept varchar(15)
) character set = utf8mb4;
insert into student values( '张三', '男', 20, 'CS');
select * from student;

new output is correct

+-------+------+------+-------+ | sname | ssex | sage | sdept | +-------+------+------+-------+ | 张三 | 男 | 20 | CS | +-------+------+------+-------+

Besides, I tried many other aproaches to solve, e.g, switch all character set to utf8 or utf8mb4, but they don't work.

ZDSDESIRE commented 4 years ago

If you are win10, you can try this: https://github.com/dbcli/mycli/issues/877#issuecomment-665533179 即“控制面板” -> "时钟和区域" -> “管理” -> 系统区域设置为中文之后,勾选“Beta版:使用 Unicode UTF-8 提供全球语言支持(U)”,重启电脑即可。