Character with encoding UTF8 has no equivalent in WIN1252

后端 未结 10 1089
挽巷
挽巷 2020-12-29 02:41

I am getting the following exception:

Caused by: org.postgresql.util.PSQLException: ERROR: character 0xefbfbd of encoding \"UTF8\" has no equivalent in \"WIN         


        
10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 03:14

    What do you do when you get this message? Do you import a file to Postgres? As devstuff said it is a BOM character. This is a character Windows writes as first to a text file, when it is saved in UTF8 encoding - it is invisible, 0-width character, so you'll not see it when opening it in a text editor.

    Try to open this file in for example Notepad, save-as it in ANSI encoding and add (or replace similar) set client_encoding to 'WIN1252' line in your file.

提交回复
热议问题