Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CB1F9632C03 for ; Mon, 4 Jan 2010 05:33:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 69870-08 for ; Mon, 4 Jan 2010 09:33:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mail.postgresql.org (Postfix) with ESMTP id E7101632222 for ; Mon, 4 Jan 2010 05:33:42 -0400 (AST) Received: by ewy26 with SMTP id 26so12854668ewy.3 for ; Mon, 04 Jan 2010 01:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=rOpbMyUkryX6Hs5texX8l2q5Nbe84l9MS4e/7A+/iEk=; b=Es8iZzmgSOvmI6u5ifuPrCCgyGj+ki4Owb7S01m794LSCYoxcOtI4kO8DBg7DgMlGy yMzY2GFXqAc82S0ihoJfjyM42sSpi01dM5KyOjbSBSoIpk1dvVaRmWQGlqIi6RhMpHzP rVVHBGYK7ULeq6EoESBvD41DUogHe/BLvE9V0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=jq09IQPj3WXWFxb7r6JT0TE3ubbpGbRiPnxj/9erONGJmZhNGYbO2lG5a54r9CjTKR xyV8Nqfaalqwmn9ZCbFsMIP8eued4g47NPc/pnYwQ99CPEAGwN2V3n12vD1Xs3pzxAZ1 Qi+hUUM720rZsNNWLm2jvGgRqwqJmWf9RdA10= MIME-Version: 1.0 Received: by 10.213.37.194 with SMTP id y2mr10572267ebd.54.1262597621061; Mon, 04 Jan 2010 01:33:41 -0800 (PST) In-Reply-To: <1676b9b1001032359q68df338cpb29051025d6beac6@mail.gmail.com> References: <1676b9b1001032359q68df338cpb29051025d6beac6@mail.gmail.com> Date: Mon, 4 Jan 2010 09:33:41 +0000 Message-ID: Subject: Re: Postgres (EUC - JP encoded ) with Unicode MFC Application From: Peter Geoghegan To: krishnan swaminathan Cc: pgsql-odbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.631 tagged_above=-10 required=5 tests=AWL=-1.220, BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/2 X-Sequence-Number: 10165 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