From: Peter Geoghegan <peter.geoghegan86@gmail.com>
To: krishnan swaminathan <krishnan1469@gmail.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Postgres (EUC - JP encoded ) with Unicode MFC Application
Date: Mon, 4 Jan 2010 09:33:41 +0000
Message-ID: <db471ace1001040133l622c9861k2472e166e068cfd2@mail.gmail.com> (raw)
In-Reply-To: <1676b9b1001032359q68df338cpb29051025d6beac6@mail.gmail.com>
References: <1676b9b1001032359q68df338cpb29051025d6beac6@mail.gmail.com>
Hi Krish,
> I have an MFC application built with unicode characterset enabled (so
> CString and the MFC API's expects wide characters) and the postgres db as
> backend which is EUC - JP encoded.
> Iam accessing my DB using CRecordset for reading the tables and direct query
> execution using ExecuteSQL for updation., Both these MFC functions expects
> wide strings of 2 bytes but my DB is multibyte encoded of 1 byte. Can anyone
> please let me know how to handle this scenario of Unicode application with
> multibyte encoded DB.
I'm not sure of the exact details of MFC's wide characters, but I do
know that if you were in a western European locale and weren't using
MFC unicode, you could set client encoding to win1251 or somesuch and
it would work.
Find out what encoding MFC wants for wide character strings, and see
if it's available as a client encoding:
http://www.postgresql.org/docs/8.4/static/multibyte.html
Incidentally, it might be worth considering ditching ODBC and using libpqxx.
Regards,
Peter Geoghegan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: peter.geoghegan86@gmail.com, krishnan1469@gmail.com
Subject: Re: Postgres (EUC - JP encoded ) with Unicode MFC Application
In-Reply-To: <db471ace1001040133l622c9861k2472e166e068cfd2@mail.gmail.com>
References: <1676b9b1001032359q68df338cpb29051025d6beac6@mail.gmail.com> <db471ace1001040133l622c9861k2472e166e068cfd2@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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