TDengine
TDengine copied to clipboard
Inserting Chinese characters with Python
Server 版本 2.0.3 在windos客户端 命令行直接插入中文数据,无论是用Python读取还是客户端直接读取,显示乱码, 使用python插入,并使用python 读取数据,编码正常。 但是使用python 插入数据,使用客户端读取,编码还是错误。 请问是需要做什么配置么?
try set properties when you establishing a connection
conn = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos",charset="UTF-8",locale="en_US.UTF-8",timezone="UTC-8")
and checkout the character of your server. you can use the command
cat /var/log/taos/taosdlog.0 | grep charset
and checkout your field type, use NCHAR to store chinese string.
```shell cat /var/log/taos/taosdlog.0 | grep charset
我的python怎么设不设置properties都是对的,现在的问题是windos客户端上显示的都是乱码,是否需要对客户端进行配置?
如果要存储中文字符,请使用nchar字段。
This issue is stale because it has been open for 30 days with no activity.