PostgreSQL 错误: 编码 "UTF8" 的字符 0x0xc9 0x99 在编码 "GBK" 没有相对应值
PostgreSQL PowerShell chcp About 629 words问题描述
在Windows的PowerShell中使用psql查询记录时抛出如下异常。
错误: 编码"UTF8"的字符0x0xc9 0x99在编码"GBK"没有相对应值
错误原因
UTF8编码的音标ˈ分隔符无法转换为GBK编码导致。
解决方法
PowerShell
首先将PowerShell的编码转为UTF8的,默认是GBK。(GBK页码936)
更多chcp相关可查看之前文章:https://www.zhangbj.com/p/358.html
chcp 65001
psql
使用\encoding查看psql客户端编码
\encoding
或者show client_encoding查看psql客户端编码
z-blog=# show client_encoding;
client_encoding
-----------------
GBK
(1 行记录)
使用show server_encoding查看PostgreSQL服务端编码
z-blog=# show server_encoding;
server_encoding
-----------------
UTF8
(1 行记录)
使用\encoding UTF8修改psql客户端编码
\encoding UTF8
或者set client_encoding=UTF8修改psql客户端编码
z-blog=# set client_encoding=UTF8;
SET
Views: 9,627 · Posted: 2020-12-17
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...