Avatar of flowerbloom
flowerbloom

asked on 

php postgresql convert mixed encoding to utf-8

I have user input/EDI that may be in different encoding (ISO, Win, etc.).  When I insert it into the database PostgreSQL complain "invalid byte sequence for encoding "UTF8".

PostgreSQL DB encoding is UTF-8.

I cannot control the user input/EDI.  The SQL query actually has mixed encoding, including UTF-8.

Is there a way to convert the none UTF-8 strings/chars to UTF-8 and ignore the strings/chars that are already UTF-8?

Thanks.
PHPPostgreSQL

Avatar of undefined
Last Comment
flowerbloom

8/22/2022 - Mon