Re: BUG #7664: Program using libpq and ecpglib can not output native language - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #7664: Program using libpq and ecpglib can not output native language
Date
Msg-id 4803.1353043336@sss.pgh.pa.us
Whole thread Raw
In response to BUG #7664: Program using libpq and ecpglib can not output native language  (chenhj@cn.fujitsu.com)
Responses Re: BUG #7664: Program using libpq and ecpglib can not output native language  (Chen Huajun <chenhj@cn.fujitsu.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: dominique-doisne@idoine-formation.com
Date:
Subject: BUG #7660: Installation problem
Next
From: Chen Huajun
Date:
Subject: Re: BUG #7664: Program using libpq and ecpglib can not output native language