Thread: encoding problem

encoding problem

From
"Sergio Medina"
Date:

I have a server with utf8 encoding, but trying to copy a csv file containing characters like ó,í,á,é,ñ in rows throws the next error.

 

******** Error *****

 

ERROR: secuencia de bytes no válida para codificación UTF8 0xf327

SQL: state: 22021

Hint: Este error también puede ocurrir si la secuencia de bytes no coinciden con la codificación esperada por el servidor, lo cual es controaldo por el parámetro cliente_encoding

 

Thanks

Re: encoding problem

From
Tom Lane
Date:
"Sergio Medina" <sergioluismedina@gmail.com> writes:
> I have a server with utf8 encoding, but trying to copy a csv file containing
> characters like �,�,�,�,� in rows throws the next error.

> ERROR: secuencia de bytes no v�lida para codificaci�n UTF8 0xf327

Well, it's right: that's not UTF8.  It looks like it might be LATIN1.
Figure out what encoding your data is really in, and then set
client_encoding to that before trying to load the CSV file.

            regards, tom lane