Re: BUG #7664: Program using libpq and ecpglib can not output native language

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: chenhj(at)cn(dot)fujitsu(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7664: Program using libpq and ecpglib can not output native language
Date: 2012-11-16 05:22:16
Message-ID: 4803.1353043336@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

chenhj(at)cn(dot)fujitsu(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chen Huajun 2012-11-16 08:02:18 Re: BUG #7664: Program using libpq and ecpglib can not output native language
Previous Message Stuart Bishop 2012-11-16 04:40:38 Re: BUG #7651: Superfluous calls to functions used for indexing