python sqlite3数据库cmd显示中文乱码
数据库中存储的没有问题,用python manage.py shell打开是正常的,但是用sqlite3打开就显示不了。
sqlite3 .\db.sqlite3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite> select * from chapter5_users;
Error: no such table: chapter5_users
sqlite> select * from chapter5_user;
1|??|20
2|??|18
3|??|25
4|??|30
5|??|20
6|??|23
sqlite> ^Z
PS D:\Files\Program\Code\Python\django\Textbook\chapter5> chcp 936
Active code page: 936
PS D:\Files\Program\Code\Python\django\Textbook\chapter5> sqlite3 .\db.sqlite3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite> select * from chapter5_user;
1|??|20
2|??|18
3|??|25
4|??|30
5|??|20
6|??|23
sqlite> ^Z
PS D:\Files\Program\Code\Python\django\Textbook\chapter5> chcp 65001
Active code page: 65001
PS D:\Files\Program\Code\Python\django\Textbook\chapter5> sqlite3 .\db.sqlite3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
sqlite> select * from chapter5_user;
1|??|20
2|??|18
3|??|25
4|??|30
5|??|20
6|??|23
sqlite> ^Z
我改了编码,没什么效果,cmd和powershell都试过了,也右键cmd标题看属性了,但是不能在那里改编码。我猜可能是因为我系统是英文的。