Re: DataDirect Driver, ExecDirect and UTF-8

From: Ken Sell <ksell(at)greenplum(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: DataDirect Driver, ExecDirect and UTF-8
Date: 2009-05-05 18:50:56
Message-ID: C625D8A0.B8%ksell@greenplum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,

I wasn't a member of the mailing list when I sent this, so I'm not sure it actually made it out there.
I apologize if this is a duplicate.

....Ken

On 5/4/09 11:49 AM, "Ken Sell" <ksell(at)greenplum(dot)com> wrote:

Hi,

I'm a the new connectivity developer at GreenPlum. GreenPlum makes a data warehouse DBMS based on PostgreSQL.
I'm working on a problem where a user is attempting to insert a non-ASCII UTF-8 values (i.e. An umlaut over an 'o').
The test does an insert via an SQLExecDirectW into a table. The text looks like this:

"insert into t1 values ('ö')"

I've built and debugged the postgreSQL driver (version 8.02.0500). It looks like the text makes it through the
Driver Manager (i.e. DataDirect) ok. I see the correct value in SQLExecDirectW in odbcapiw.c, but I
also see the code in SQLExecDirectW call ucs2_to_utf8. ucs2_to_utf8 tries to interpret the value as
UCS2, but the value is UTF-8. The value is corrupted by ucs2_to_utf8.

I also attempted to call SQLExecDirect (i.e. no W), but the DataDirect driver manager tries to convert the
umlaut value to ASCII and calls SQLExecDirectW instead.

Can someone elaborate on the driver's correct behavior in this situation? If the database is UTF-8 and
The application is UTF-8, should the driver handle this? Does the application (or driver manager) have
to convert the string to UCS2 first?

Thanks,

....Ken

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Adam Ruth 2009-05-05 20:47:52 Re: Unsupported Type UUID
Previous Message Hiroshi Inoue 2009-05-05 14:58:07 Re: odbc + refcursor + vb6