0

Prehistory: Hello, i saw many questions about encoding in postgres, but. I have UFT8 table, and i'm using COPY function to import that table in CSV, and i need to make COPY with different encodings like WIN1251 and SQL_ASCII.

Problem: When in table i have characters that not supported in WIN1251/SQL_ASCII, i will got classic error

character with byte sequence 0xe7 0xb0 0xab in encoding "UTF8" has no equivalent in encoding "WIN1251"

I tried using "set client_encoding/ convert / convert_to" - no success.

Main question: Is there any way to do this without error using sql?

1 Answer 1

1

There is simply no way to convert 簫 into Windows-1252, so you can forget about that.

If you set the client encoding to SQL_ASCII, you will be able to load the data into an SQL_ASCII database, but that is of little use, since the database does not recognize it as a character, but three meaningless bytes above 127.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.