Thread: psql encoding problem

psql encoding problem

From
T E Schmitz
Date:
Hello,

I am trying to insert the following record:

INSERT INTO item (name,retail_price) VALUES  ('Cheese Soufflé',7.95,);

(I presume you see the accented character in *Soufflé*)

psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9"
If I do this via DbVisualizer, the record is inserted fine.

Is there any way around this problem?

-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz


Re: psql encoding problem

From
Ragnar Hafstað
Date:
On Mon, 2005-02-28 at 20:48 +0000, T E Schmitz wrote:

> INSERT INTO item (name,retail_price) VALUES  ('Cheese Soufflé',7.95,);
> 
> (I presume you see the accented character in *Soufflé*)
> 
> psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9"
> If I do this via DbVisualizer, the record is inserted fine.

might be the client encoding.

test=# CREATE DATABASE unitest with ENCODING='UNICODE';
CREATE DATABASE
test=# \connect unitest
You are now connected to database "unitest".
unitest=# create table a (n text);
CREATE TABLE
unitest=# insert into a values ('Cheese Soufflé is cool');
ERROR:  invalid byte sequence for encoding "UNICODE": 0xe92069
unitest=# set client_encoding='LATIN1';
SET
unitest=# insert into a values ('Cheese Soufflé is cool');
INSERT 7533697 1
unitest=# select * from a;          n
------------------------Cheese Soufflé is cool
(1 row)

unitest=#


gnari




Re: psql encoding problem

From
"Joel Fradkin"
Date:
I had the same issue using odbc, but .net you can use encodeing = unicode,
so not sure what you are using to do the connection.
Since I am using ODBC with my ASP I had to switch from Unicode to SQL_ASCHII
for my data base.
In effect it tells the database you don’t know about the encoding and makes
some of the routines like upper not work properly on extended chars.

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, IncThis email message is for the use of the intended recipient(s)
andmay 
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 T E Schmitz
Sent: Monday, February 28, 2005 3:48 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] psql encoding problem

Hello,

I am trying to insert the following record:

INSERT INTO item (name,retail_price) VALUES  ('Cheese Soufflé',7.95,);

(I presume you see the accented character in *Soufflé*)

psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9"
If I do this via DbVisualizer, the record is inserted fine.

Is there any way around this problem?

--


Regards/Gruß,

Tarlika Elisabeth Schmitz

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Re: psql encoding problem

From
T E Schmitz
Date:
Hello Ragnar,

Ragnar Hafstað wrote:
> On Mon, 2005-02-28 at 20:48 +0000, T E Schmitz wrote:
> 
> 
>>INSERT INTO item (name,retail_price) VALUES  ('Cheese Soufflé',7.95,);
>>
>>psql comes back with "invalid byte sequence for encoding "UNICODE": 0xe9"
> 
> might be the client encoding.

> set client_encoding='LATIN1';

sorted my problem - many thanks!

> gnari


-- 


Regards/Gruß,

Tarlika