LinberEight 2022-11-07 09:00 采纳率: 0%
浏览 14

关于#SQL#的问题,如何解决?

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标题看属性了,但是不能在那里改编码。我猜可能是因为我系统是英文的。

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-11-07 12:08
    关注
    评论

报告相同问题?

问题事件

  • 创建了问题 11月7日

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?