Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using mycli sometimes Chinese gibber #725

Closed
wangxingzhen opened this issue Mar 30, 2019 · 2 comments
Closed

Using mycli sometimes Chinese gibber #725

wangxingzhen opened this issue Mar 30, 2019 · 2 comments

Comments

@wangxingzhen
Copy link

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

@Wistral
Copy link

Wistral commented Jun 3, 2019

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:

  • if I create a table and insert data by
create table student(
    sno int,
    sname varchar(6),
    ssex varchar(1),
    sage int unsigned,
    sdept varchar(15)
) character set = utf8mb4;
insert into student values(15001, '张三2', '', 20, 'CS');
select * from student;

the output is gibber

+-------+-------+------+------+-------+
| sno | sname | ssex | sage | sdept |
+-------+-------+------+------+-------+
| 15001 | 寮犱笁2 | 鐢? | 20 | CS |
+-------+-------+------+------+-------+

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants