pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into bytea.
5+ messages / 3 participants
[nested] [flat]

* Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into bytea.
@ 2006-12-12 15:23  bartek@mikronika.com.pl
  0 siblings, 1 reply; 5+ messages in thread

From: bartek@mikronika.com.pl @ 2006-12-12 15:23 UTC (permalink / raw)
  To: pgsql-odbc

Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into
bytea.

PostgreSQL: 8.1.5
Driver: psqlodbc-08.01.0200
Database in UTF-8.
Local encoding: LC_ALL=pl_PL.ISO-8859-2

In " convert_to_pgbinary" :
isalnum(0xa1) return true for pl_PL.ISO-8859-2 but it isn't ascii
character and should be convert to octal.

Solution:
======================diff_file=================================
inline patch 1: popr/convert.c (+9/-0 lines) download inline-1.patch--- oryg/convert.c 2006-01-08 11:09:52.000000000 +0100 +++ popr/convert.c 2006-12-05 11:24: 20.000000000 +0100 @@ -3709,6 +3709,15 @@ } +BOOL myisalnum(UCHAR c) +{ + if(isalnum(c) && c <128) + return TRUE; + + return FALSE; +} + + /* convert non-ascii bytes to octal escape sequences */ int convert_to_pgbinary(const UCHAR *in, char *out, int len) @@ -3719,7 +3728,7 @@ for (i = 0; i < len; i++) { mylog("convert_to_pgbinary: in[%d] = %d, %c\n", i, in[i],
in[i]); - if (isalnum(in[i]) || in[i] == ' ') + if (myisalnum(in[i]) || in[i] == ' ') out[o++] = in[i]; else { ========================================================= ^ permalink raw reply [nested|flat] 5+ messages in thread

* [ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8": 0x92
@ 2006-12-12 15:26  noreply@pgfoundry.org
  0 siblings, 0 replies; 5+ messages in thread

From: noreply@pgfoundry.org @ 2006-12-12 15:26 UTC (permalink / raw)
  To: noreply@pgfoundry.org

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

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Farid Zidan (faridz)
Assigned to: Nobody (None)
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


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

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



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

* [ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8": 0x92
@ 2006-12-12 23:50  noreply@pgfoundry.org
  0 siblings, 0 replies; 5+ messages in thread

From: noreply@pgfoundry.org @ 2006-12-12 23:50 UTC (permalink / raw)
  To: noreply@pgfoundry.org

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=1000836&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Farid Zidan (faridz)
Assigned to: Nobody (None)
>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-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=1000836&group_id=1000125



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

* Re: Invalid byte sequence for encoding "UTF8": 0xa1 - when
@ 2006-12-13 03:29  Hiroshi Inoue <inoue@tpf.co.jp>
  parent: bartek@mikronika.com.pl
  0 siblings, 1 reply; 5+ messages in thread

From: Hiroshi Inoue @ 2006-12-13 03:29 UTC (permalink / raw)
  To: bartek@mikronika.com.pl; +Cc: pgsql-odbc

bartek@mikronika.com.pl wrote:
> Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into
> bytea.
> 
> PostgreSQL: 8.1.5
> Driver: psqlodbc-08.01.0200
> Database in UTF-8.
> Local encoding: LC_ALL=pl_PL.ISO-8859-2
> 
> In " convert_to_pgbinary" :
> isalnum(0xa1) return true for pl_PL.ISO-8859-2 but it isn't ascii
> character

Looking at the manual page I found it can be true.

 > and should be convert to octal.

I would take care of it.
Thanks.

regards,
Hiroshi Inoue



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

* Re: Invalid byte sequence for encoding "UTF8": 0xa1 - when
@ 2006-12-18 06:42  Hiroshi Inoue <inoue@tpf.co.jp>
  parent: Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 0 replies; 5+ messages in thread

From: Hiroshi Inoue @ 2006-12-18 06:42 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: bartek@mikronika.com.pl; pgsql-odbc

Hiroshi Inoue wrote:
> bartek@mikronika.com.pl wrote:
>> Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into
>> bytea.
>>
>> PostgreSQL: 8.1.5
>> Driver: psqlodbc-08.01.0200
>> Database in UTF-8.
>> Local encoding: LC_ALL=pl_PL.ISO-8859-2
>>
>> In " convert_to_pgbinary" :
>> isalnum(0xa1) return true for pl_PL.ISO-8859-2 but it isn't ascii
>> character
> 
> Looking at the manual page I found it can be true.
> 
>  > and should be convert to octal.
> 
> I would take care of it.
> Thanks.

Please try the snapshot dll at
   http://www.geocities.jp/inocchichichi/psqlodbc/index.html
.

regards,
Hiroshi Inoue



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


end of thread, other threads:[~2006-12-18 06:42 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-12 15:23 Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into bytea. bartek@mikronika.com.pl
2006-12-13 03:29 ` Re: Invalid byte sequence for encoding "UTF8": 0xa1 - when Hiroshi Inoue <inoue@tpf.co.jp>
2006-12-18 06:42   ` Re: Invalid byte sequence for encoding "UTF8": 0xa1 - when Hiroshi Inoue <inoue@tpf.co.jp>
2006-12-12 15:26 [ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8": 0x92 noreply@pgfoundry.org
2006-12-12 23:50 [ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8": 0x92 noreply@pgfoundry.org

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