Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZENi-0007ZO-BQ for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 05:22:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZENg-0000Ly-T8 for pgsql-bugs@postgresql.org; Fri, 16 Nov 2012 05:22:21 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qAG5MGxB004804; Fri, 16 Nov 2012 00:22:16 -0500 (EST) From: Tom Lane To: chenhj@cn.fujitsu.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7664: Program using libpq and ecpglib can not output native language In-reply-to: References: Comments: In-reply-to chenhj@cn.fujitsu.com message dated "Fri, 16 Nov 2012 03:48:42 +0000" Date: Fri, 16 Nov 2012 00:22:16 -0500 Message-ID: <4803.1353043336@sss.pgh.pa.us> X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201211/88 X-Sequence-Number: 34646 chenhj@cn.fujitsu.com writes: > 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? No, it would most certainly be inappropriate for a library to do that. setlocale could completely break a program that wasn't expecting it. The effects would be global across the whole process, not confined to the library. regards, tom lane