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