PostgreSQL 错误: 编码 "UTF8" 的字符 0x0xc9 0x99 在编码 "GBK" 没有相对应值
PostgreSQL PowerShell chcp 评论 1 大约 629 字问题描述
在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
阅读 6433 · 发布于 2020-12-17
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
-
pg 1楼
https://stackoverflow.com/questions/20952893/postgresql-encoding-problems-on-windows-when-using-psql-command-line-utility
Chrome | Windows 10 2021-06-03
随便看看
换一批
-
Linux 命令之解压缩阅读 2305
-
Prometheus+Grafana+redis_exporter 监控 Redis 服务阅读 1108
-
Linux tac 倒序查看文本内容阅读 3055
-
lanyus激活时IDEA提示your activation code could not be validated error 1653219阅读 275708
-
Kubernetes Pod 控制器 HPA阅读 957
-
IDEA Debug 异常断点阅读 936
-
JavaScript 对象阅读 1306
-
Spring Boot 3 使用 Spring Native 构建二进制可执行文件阅读 970
-
监测广告位是否被 AdBlock 拦截阅读 1620
-
JavaScript 判断字符串是否包含指定字符阅读 746