PotgreSQL-错误:用于编码"UTF8"的无效字节序列:0xeb 0x6e 0x74 [英] PotgreSQL- ERROR: invalid byte sequence for encoding "UTF8": 0xeb 0x6e 0x74

查看:80
本文介绍了PotgreSQL-错误:用于编码"UTF8"的无效字节序列:0xeb 0x6e 0x74的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在PostgreSQL上工作,并且从批处理脚本(命令行)执行插入语句时遇到错误.

I am working on PostgreSQL and getting below error during insert statement execution from batch script(command line).

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

ERROR: invalid byte sequence for encoding "UTF8": 0xeb 0x6e 0x74

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

I have checked client_encoding by show client_encoding command and it is showing UTF-8.

还使用命令

从pg_database中选择*,其中datname ='< mydbName>'

在输出中:

datcollat​​e = English_United States.1252datctype = English_United States.1252

如何解决此问题?

推荐答案

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

If the three bytes quoted by the error message are supposed to encode the string “ënt”, you can solve your problem by setting the correct client encoding, e.g.

SET client_encoding = WIN1252;

这篇关于PotgreSQL-错误:用于编码"UTF8"的无效字节序列:0xeb 0x6e 0x74的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆