[unixODBC-support] [Spam 3.00] Re: [Spam 3.00] Re: unixODBC not working with psqlodbc 08.04.0200 on Linux x64

Nick Gorham nick at lurcher.org
Mon Feb 15 08:16:09 GMT 2010


Luke Coldiron wrote:
> On Linux with unixODBC and the Postgres ANSI driver and the same C++ 
> code I am not able to do this.
> Example:
> CREATE TABLE luke_test(a TEXT);
> INSERT INTO luke_test (a) VALUES('ý');
> Error executing "INSERT INTO luke_test (a) VALUES('ý');": ERROR: 
> invalid byte sequence for encoding "UTF8": 0xfd;
> Error while executing the query
> INSERT INTO luke_test (a) VALUES('þ');
> Error executing "INSERT INTO luke_test (a) VALUES('þ');": ERROR: 
> invalid byte sequence for encoding "UTF8": 0xfe;
> Error while executing the query
> INSERT INTO luke_test (a) VALUES('ÿ');
> Error executing "INSERT INTO luke_test (a) VALUES('ÿ');": ERROR: 
> invalid byte sequence for encoding "UTF8": 0xff;
> Error while executing the query
> SELECT * FROM luke_test;
> DROP TABLE luke_test;
>
> The only thing that I could think of is that unixODBC is treating the 
> character encoding as UTF8 and I would like it to just look at each 
> byte as unsigned chars.  Should this work in unixODBC or am I off base?
Ok,

I don't think thats down to unixODBC in this case, it just passes the 
character to the driver. I think this is a question better asked of the 
postgres folk as any answer I gave would be a guess, and they will know 
the real answer.

Just one thing to check (that is one of the guesses), see if you have 
environment LANG that is UTF and if so change to use non UTF.

-- 
Nick


More information about the unixODBC-support mailing list