zl程序教程

您现在的位置是:首页 >  Python

当前栏目

解决Python读取SQL Server中文乱码问题

2023-03-14 22:52:55 时间

SQL Server中涉及到中文的缺省字符集是CP936,所以将charset配置为CP936,就解决了中文乱码的问题。

import pymssql
conn = pymssql.connect(server="xxx",user="xxx",password="xxx",database="xxx",charset='cp936')