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

From bartek@mikronika.com.pl
Subject Invalid byte sequence for encoding "UTF8": 0xa1 - when insert data into bytea.
Date
Msg-id 16562.192.168.3.191.1165937037.squirrel@www2
Whole thread Raw
Responses Re: Invalid byte sequence for encoding "UTF8": 0xa1 - when  (Hiroshi Inoue <inoue@tpf.co.jp>)
List 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=================================
--- 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
                {
=========================================================




pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000836 ] invalid byte sequence for encoding "UTF8": 0x92
Next
From:
Date:
Subject: [ psqlodbc-Bugs-1000735 ] segfault at disconnect (CC_clear_error:414)