Обсуждение: Unicode problem inserting records - Invalid UNICODE character sequence found (0xfc7269)
My first time using unicode. Based on reading other messages I think I've got it all setup correctly but still have prob. Running: psql 7.3.6-RH $ psql -l List of databases Name | Owner | Encoding -----------+----------+-----------devdb | devuser | UNICODEtemplate0 | postgres | SQL_ASCIItemplate1 | postgres | SQL_ASCII I've tried two different table structures: CREATE TABLE airport_code ( airport_name character varying(70), airport_code character varying(10), ) ; and the same but with "text" instead of character varying. For both I get the same results when I try to: INSERT INTO airport_code ( airport_name, airport_code ) values ( 'Zurich (Zürich) - Kloten', 'ZRH' ) ; I get: psql:airport_codes.sql:1728: ERROR: Invalid UNICODE character sequence found (0xfc7269) Obviously I'd like to keep the proper German spelling. What am I missing? Gotta figure its me...cause PG is so damm good otherwise. Tx, D --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.771 / Virus Database: 518 - Release Date: 9/28/2004
David B wrote: > My first time using unicode. Based on reading other messages I think I've > got it all setup correctly but still have prob. > Running: psql 7.3.6-RH [snip] > For both I get the same results when I try to: > > INSERT INTO airport_code ( airport_name, airport_code ) values ( 'Zurich > (Zürich) - Kloten', 'ZRH' ) ; > > > I get: > > psql:airport_codes.sql:1728: ERROR: Invalid UNICODE character sequence > found (0xfc7269) > > Obviously I'd like to keep the proper German spelling. What is your client encoding? (look into "show client_encoding", "\encoding" in the "Localization" chapter of the manuals) -- Richard Huxton Archonet Ltd
show client_encoding gives: UNICODE databases reads: DATABASE OWNER ENCODING mydb david UNICODE testdb david SQL_ASCII table columns are character varying(255) Tx, David -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Richard Huxton Sent: Wednesday, November 10, 2004 10:34 AM To: David B Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Unicode problem inserting records - Invalid UNICODE character David B wrote: > My first time using unicode. Based on reading other messages I think I've > got it all setup correctly but still have prob. > Running: psql 7.3.6-RH [snip] > For both I get the same results when I try to: > > INSERT INTO airport_code ( airport_name, airport_code ) values ( 'Zurich > (Zürich) - Kloten', 'ZRH' ) ; > > > I get: > > psql:airport_codes.sql:1728: ERROR: Invalid UNICODE character sequence > found (0xfc7269) > > Obviously I'd like to keep the proper German spelling. What is your client encoding? (look into "show client_encoding", "\encoding" in the "Localization" chapter of the manuals) -- Richard Huxton Archonet Ltd ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings --- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.771 / Virus Database: 518 - Release Date: 9/28/2004
David B wrote: > show client_encoding gives: > UNICODE > > databases reads: > DATABASE OWNER ENCODING OK - with the same settings here, I start psql and do: \i unicode_import_test.txt I get: CREATE TABLE t --------- AAA À È Ð Ø ZZZ (3 rows) In case this gets garbled by my email, the middle line contains four accented characters, with accents as follows: A` E` D- O/ Actually, this doesn't display properly in my usual terminal (konsole under KDE) but does under xterm. -- Richard Huxton Archonet Ltd CREATE TABLE foo (t text); -- DELETE FROM foo; COPY foo FROM STDIN; AAA À È Ð Ø ZZZ \. SELECT * FROM foo;
Hi, David, On Thu, 11 Nov 2004 11:29:22 -0800 "David B" <postgresql@thegatelys.com> wrote: > show client_encoding gives: > UNICODE So is the data you send also encoded in unicode? Maybe "set client_encoding latin1" or "\encoding latin1" helps. 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