问题
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