pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres (EUC - JP encoded ) with Unicode MFC Application
2+ messages / 2 participants
[nested] [flat]

* Postgres (EUC - JP encoded ) with Unicode MFC Application
@ 2010-01-04 07:59  krishnan swaminathan <krishnan1469@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: krishnan swaminathan @ 2010-01-04 07:59 UTC (permalink / raw)
  To: pgsql-odbc

Hi ,

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.

Thanks
Krish

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Postgres (EUC - JP encoded ) with Unicode MFC Application
@ 2010-01-04 09:33  Peter Geoghegan <peter.geoghegan86@gmail.com>
  parent: krishnan swaminathan <krishnan1469@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Geoghegan @ 2010-01-04 09:33 UTC (permalink / raw)
  To: krishnan swaminathan <krishnan1469@gmail.com>; +Cc: pgsql-odbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-01-04 09:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-01-04 07:59 Postgres (EUC - JP encoded ) with Unicode MFC Application krishnan swaminathan <krishnan1469@gmail.com>
2010-01-04 09:33 ` Peter Geoghegan <peter.geoghegan86@gmail.com>

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