[ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8&quot

[ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8&quot

am 19.12.2006 05:42:08 von noreply

Bugs item #1000836, was opened at 2006-12-12 15:26
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=10008 36&group_id=1000125

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Farid Zidan (faridz)
>Assigned to: Hiroshi Inoue (hinoue)
Summary: invalid byte sequence for encoding "UTF8": 0x92

Initial Comment:
Example,

create table test_char (
code CHAR(5) not null,
description VARCHAR(50) not null
constraint pk_test_char primary key (code)
);

insert into
test_char values ('TEST','description');

update test_char
set
description = "Destruction of add’l lesions -del 1998"
where
code = 'TEST'

Gets this error message:
Error: ERROR: invalid byte sequence for encoding "UTF8": 0x92;
Error while executing the query (State:22021, Native Code: 7)


This also happens if you try to execute the update using SQLExecDirect api call. Database encoding is UTF8. Driver PostgreSQL ANSI 8.02.02.03


------------------------------------------------------------ ----------

>Comment By: Hiroshi Inoue (hinoue)
Date: 2006-12-19 04:42

Message:
The snapshot dll at http://www.geocities.jp/inocchichichi/psqlodbc/index.html
would set the client_encoding automaically for code pages
125x if the server supports the client_encoding win125x.

------------------------------------------------------------ ----------

Comment By: Farid Zidan (faridz)
Date: 2006-12-13 18:04

Message:
That does it. Now I am able to execute the update with no
error. Thanks.

------------------------------------------------------------ ----------

Comment By: Hiroshi Inoue (hinoue)
Date: 2006-12-13 17:31

Message:
Please try to set the Connect Settings option e.g.
set client_encoding to win1252
..

If I improve the automatic client_encoding setting
mechanism, such a setting may not be needed.

regards,
Hiroshi Inoue

------------------------------------------------------------ ----------

Comment By: Farid Zidan (faridz)
Date: 2006-12-13 16:21

Message:
Not sure how to set client encoding for the driver. My
machine is Windows XP SP2 and PostgreSQL server version is
the latest 8.2

I am attaching global mylog file

------------------------------------------------------------ ----------

Comment By: Hiroshi Inoue (hinoue)
Date: 2006-12-13 16:02

Message:
Do you want to set the client_encoding to WIN1252 ?
The client_encoding seems to be set to the one other
than WIN1252 but I can't see the setting in your log.
If you set the global Mylog option, you can see the
setting in the log.

BTW is your server version < 8.1 ?
WIN1252 wasn't supported in versions before 8.1.

------------------------------------------------------------ ----------

Comment By: Farid Zidan (faridz)
Date: 2006-12-13 14:45

Message:
Mylog is attached.

I have reduced the string to the minimum that duplicates
this error.

update test_char
set
description = 'add’l'
where
code = 'TEST'

You get this error if you execute this statement from an
ODBC client such as WinSQL, etc. Also by calling SQLExecDirect

No error if you use PostgreSQL PgAdmin III query tool ( does
not use ODBC ), but updated info is incorrect.




------------------------------------------------------------ ----------

Comment By: Hiroshi Inoue (hinoue)
Date: 2006-12-12 23:50

Message:
Could you show me the Mylog output ?
BTW I can't see the character between 'Destruction of add l'
and 'lesions -del 1998' here. Is it the character corrsponding
to 0x92 ?

regards,
Hiroshi Inoue

------------------------------------------------------------ ----------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=10008 36&group_id=1000125

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq