C#连接PostgreSQL查询中文字符出现乱码情况

在连接字符串末尾加上encoding=UNICODE

string connStr = "Server=localhost;Port=5432;UserId=xxxx;Password=xxxxx;Database=test;encoding=UNICODE";

否则会出现中文字符显示如下:

猜你喜欢

转载自www.cnblogs.com/huangyanjia/p/12389759.html
今日推荐