Getting error : invalid string conversion occured. - Mailing list pgsql-odbc

From Abhishek Kumar
Subject Getting error : invalid string conversion occured.
Date
Msg-id CAAyULEDVAWounPX-RKuzDR42HRAMDaMRz0pSAp3mFH3BYKF2NQ@mail.gmail.com
Whole thread Raw
Responses Re: Getting error : invalid string conversion occured.
List pgsql-odbc
Hi,

I am using psqlodbc native driver with my C++ application. I am facing errors in the below scenario.

I have a PostgreSQL database (Server character set is UTF-8, Database character set is UTF-8)
My System character set/locale is ASCII. The session character set is also ASCII.
Below is the details of the table i am using
CREATE TABLE conv_vchar (
    id SERIAL PRIMARY KEY,
    vchar_col VARCHAR(255)
);

I am inserting some characters in table varchar column which is only available in UTF-8 and not in ASCII.
The characters are "कखग".
please note that none of these characters is present in ASCII.

I have tried binding the varchar column with the below two types. Both give me the same error
1. SQL_C_BINARY
2. SQL_C_CHAR

ODBC error: SQLSTATE S1000 native database error 36. invalid string conversion occured.

Is there a correct way to bind this?
How can this be fixed?

Your help will be highly appreciated.

Regards,
Abhishek Kumar

pgsql-odbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Need information on bind type for certain data types in PostgreSQL
Next
From: Abhishek Kumar
Date:
Subject: Re: Getting error : invalid string conversion occured.