Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZCvA-0006dr-8F for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 03:48:48 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZCv6-0000oH-Jt for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 03:48:47 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZCv5-0002Up-0K for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 03:48:43 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TZCv4-0002iN-H0 for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 03:48:42 +0000 Date: Fri, 16 Nov 2012 03:48:42 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7664: Program using libpq and ecpglib can not output native language To: pgsql-bugs@postgresql.org From: chenhj@cn.fujitsu.com X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201211/82 X-Sequence-Number: 34640 The following bug has been logged on the website: Bug reference: 7664 Logged by: Chen Huajun Email address: chenhj@cn.fujitsu.com PostgreSQL version: 9.1.6 Operating system: Linux Description: = The error messages output by libpq or ecpglib is always be english. But my expect is my native language. Step: 1)compile my program which linked to libpq or ecpglib. 2)set my locale to native language. set LANG=3Dja_JP.UTF-8 set LC_ALL=3Dja_JP.UTF-8 3)run my program and let it raise an error. I knows reason. The default locale of a program is "C" in Linux,regardless the Environment Variables. if add the following line in my program,everything is OK. setlocale(LC_ALL, ""); But I found no document tell users should do so.And I think it's not a easy way.Can libpq and ecpglib do it for users? *=EF=BC=89Windows is OK.Solaris may has the same problem.