I'm trying to import some data from a bunch of tables in an PostgreSQL database in another bunch of tables in another PostgreSQL database. For importing I use PHP because I need to make some data manipulation before inserting it in the new database.
All went ok until some point where there is some text which contains single quotes. I tried to escape those quotes before inserting the data and i get this error:
ERROR: invalid byte sequence for encoding "UTF8": 0x96 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
The encoding on the old database is SQL_ASCII, while on the new database I have UTF8.
How can I solve this issue?