PotgreSQL-错误:编码“UTF8”的字节序列无效:0xeb 0x6e 0x74

Mru*_*nal 2 postgresql encoding character-encoding pgadmin-4

我正在研究 PostgreSQL,并在从批处理脚本(命令行)执行插入语句期间遇到以下错误。

错误:编码“UTF8”的字节序列无效:0xeb 0x6e 0x74

我已经通过show client_encoding命令检查了 client_encoding,它显示 UTF-8。

还使用命令检查数据库属性

select * from pg_database where datname='<mydbName>'

在输出中

datcollate = English_United States.1252 datctype = English_United States.1252

如何解决这个问题?

Lau*_*lbe 5

如果错误消息引用的三个字节应该编码字符串“ënt”,您可以通过设置正确的客户端编码来解决您的问题,例如

SET client_encoding = WIN1252;
Run Code Online (Sandbox Code Playgroud)