ERROR: invalid byte sequence for encoding "UTF8": 0xfc

Started by armand pirvuabout 8 years ago2 messagesgeneral
Jump to latest
#1armand pirvu
armand.pirvu@gmail.com

Folks

From another system (non postgres) as data gets changed we collect in the form like below into a named pipe which is tailed into psql -U csidba -d repdb -hrephost

insert into foo (mydata) values ('{"mail_stop": "" , "city_id": "Garching bei M?nchen"}');

And got a failure
ERROR: invalid byte sequence for encoding "UTF8": 0xfc

insert into foo (mydata) values ('{"mail_stop": "" , "city_id": "Garching bei M?nchen"}');

Problem is said system to convert to UTF8 is nicely put a huge amount of effort and we don't have the resources anyway at this point

This is not a copy, just a tailed named pipe into psql

Is there any trick/way I can shove this data into Postgres ? I really don't care whether it read "Garching bei M?nchen" or "Garching bei Mfoonchen"

Thanks
— Armand

#2armand pirvu
armand.pirvu@gmail.com
In reply to: armand pirvu (#1)
Re: ERROR: invalid byte sequence for encoding "UTF8": 0xfc

On Mar 27, 2018, at 3:47 PM, armand pirvu <armand.pirvu@gmail.com> wrote:

Folks

From another system (non postgres) as data gets changed we collect in the form like below into a named pipe which is tailed into psql -U csidba -d repdb -hrephost

insert into foo (mydata) values ('{"mail_stop": "" , "city_id": "Garching bei M?nchen"}');

And got a failure
ERROR: invalid byte sequence for encoding "UTF8": 0xfc

insert into foo (mydata) values ('{"mail_stop": "" , "city_id": "Garching bei M?nchen"}');

Problem is said system to convert to UTF8 is nicely put a huge amount of effort and we don't have the resources anyway at this point

This is not a copy, just a tailed named pipe into psql

Is there any trick/way I can shove this data into Postgres ? I really don't care whether it read "Garching bei M?nchen" or "Garching bei Mfoonchen"

Thanks
— Armand

Sorry for double posting but I found that if I change the client_encoding to WIN1252 I am able to move forward

"city_id": "Garching bei München”