Re: problem inserting local characters ... - Mailing list pgsql-sql

From Markus Schaber
Subject Re: problem inserting local characters ...
Date
Msg-id 421B3650.2020203@logi-track.com
Whole thread Raw
In response to problem inserting local characters ...  (Garry <gkg@gmx.de>)
Responses Re: problem inserting local characters ...  ("Joel Fradkin" <jfradkin@wazagua.com>)
List pgsql-sql
Hi, Garry,

Garry schrieb:

> Trying to do this insert, I get an error on both the values
> "TelefonGeschäft" and "Firmenstraße":
>
> FEHLER:  ungültige Byte-Sequenz für Kodierung »UNICODE«: 0xe165

This sounds as your database was created in unicode (utf-8).

> (the 0xe165 differs between the two; the fields in question are regular
> type "text" fields)
>
> Looks like I'm having some trouble with unicode encoding ... The
> characters I have are regular 8bit ASCII chars ... How can I fix this?

No, 8bit ASCII does not exist. ASCII always is 7 bit. As your error
message is in German, I suspect your data is encoded in LATIN1 or LATIN9
(their only difference is the EUR symbol in the latter one).

Can you try to add the following command before your insert statements:

set client_encoding to latin1;

HTH,
Markus

--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com


pgsql-sql by date:

Previous
From: Markus Schaber
Date:
Subject: Re: pg primary key bug?
Next
From: George Weaver
Date:
Subject: Re: Working with XML.