Emacs 读sql server数据库(数据cp936)中文乱码问题。

When I run a python program under Emacs Eshell for retrieving data from Microsoft SQL Server on Windows OS, Emacs shows garbled characters to me. It seems that SQL Server uses CP936 encoding. Can you tell me how to solve the problem?

python 复制代码
 1  """查询指定合同号的采购订单状态"""
 2  import sys
 3 -sys.stdout.reconfigure(encoding='utf-8')
 3 +sys.stdout.reconfigure(encoding='cp936')
 4
 5  from kis.db import query

Problem solved

相关推荐
weixin_4398575417 分钟前
短剧MP4合并器
python·mp4合并·短剧合并
李可以量化40 分钟前
量化之MiniQMT 实战:一键读取通达信自选股并实时监控涨跌幅(附完整可运行代码)
开发语言·python·量化·qmt·ptrade
CTA量化套保1 小时前
一个账户跑多个期货策略:仓位与报单隔离思路
python·区块链
机汇五金_1 小时前
影响交换机箱体使用寿命的几个关键因素
运维·服务器·网络·python
子午1 小时前
基于DeepSeek的酒店客房管理系统~Python+DeepSeek智能问答+Vue3+Web网站系统
开发语言·前端·python
编程大师哥1 小时前
最高效的 IO 并发方案
linux·网络·python
Hello:CodeWorld1 小时前
Dify 从入门到实战:部署、模型对接与企业级 AI 应用开发全教程
人工智能·python·架构·ai编程
本地化文档1 小时前
black-docs-l10n
python·github·gitcode·sphinx
Dream_ksw1 小时前
Python 基础
开发语言·python
清水白石0082 小时前
从打印对象到高质量调试:彻底理解 Python 中 `__repr__` 和 `__str__` 的区别
开发语言·python