PotgreSQL- ERROR: invalid byte sequence for encoding “UTF8”: 0xeb 0x6e 0x74

被刻印的时光 ゝ 提交于 2021-02-07 11:00:46

问题


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

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

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

Also checked database properties by using command

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

In Output:

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

How to resolve this issue?


回答1:


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;


来源:https://stackoverflow.com/questions/51056511/potgresql-error-invalid-byte-sequence-for-encoding-utf8-0xeb-0x6e-0x74

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!