pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
problem inserting local characters ...
3+ messages / 3 participants
[nested] [flat]

* problem inserting local characters ...
@ 2005-02-22 13:01  Garry <gkg@gmx.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Garry @ 2005-02-22 13:01 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I'm running PostGreSql 7.4.6 on SuSE 9.1. Everything as such is working 
fine. In order to import some data from an old system, I create an SQL 
script that does something like:

insert into prg_contacts values ('2005-02-22 13:45:36+01','NETHINKS 
Converter',NULL,NULL,'admin','s',
NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,
NULL,'Anrede','Titel','Vorname',
NULL,'Firmenname','TelefonGeschäft','Faxnr',
'TelefonMobil','email@email.de',NULL,NULL,
'SMS-Pager','2.email@email.de','Firmenland','FirmenOrt',
'FirmenPLZ',NULL,'Firmenbundesland','Firmenstraße',
NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,
[..]

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

(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?

Help appreciated, -gg



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: problem inserting local characters ...
@ 2005-02-22 13:40  Markus Schaber <schabios@logi-track.com>
  parent: Garry <gkg@gmx.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Markus Schaber @ 2005-02-22 13:40 UTC (permalink / raw)
  To: Garry <gkg@gmx.de>; +Cc: 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

Attachments:

  signature.asc (application/pgp-signature, 255B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: problem inserting local characters ...
@ 2005-02-22 14:34  Joel Fradkin <jfradkin@wazagua.com>
  parent: Markus Schaber <schabios@logi-track.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Joel Fradkin @ 2005-02-22 14:34 UTC (permalink / raw)
  To: 'Markus Schaber' <schabios@logi-track.com>; 'Garry' <gkg@gmx.de>; +Cc: pgsql-sql

I had a similar problem myself and found if I used SQL_ASCHII for the data
base I could insert my data.

I understand however that it basically means the database does not know
anything about encoding and therefore stuff like upper does not work on the
extended chars.

I ended up changing to sql_aschii so both my inserts and backup and restore
work, realizing I am giving up some functionality.

Joel Fradkin
 
Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305
 
jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
© 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and delete and destroy
all copies of the original message, including attachments.
 

 

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Markus Schaber
Sent: Tuesday, February 22, 2005 8:41 AM
To: Garry
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] problem inserting local characters ...

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-02-22 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 13:01 problem inserting local characters ... Garry <gkg@gmx.de>
2005-02-22 13:40 ` Markus Schaber <schabios@logi-track.com>
2005-02-22 14:34   ` Joel Fradkin <jfradkin@wazagua.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox