pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: chenhj@cn.fujitsu.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7664: Program using libpq and ecpglib can not output native language
Date: Fri, 16 Nov 2012 00:22:16 -0500
Message-ID: <4803.1353043336@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TZCv4-0002iN-H0@wrigleys.postgresql.org>
References: <E1TZCv4-0002iN-H0@wrigleys.postgresql.org>

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




view thread (5+ messages)  latest in thread

Message-ID: <4803.1353043336@sss.pgh.pa.us>
Permalink:  ../4803.1353043336@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4803.1353043336@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chenhj@cn.fujitsu.com
  Subject: Re: BUG #7664: Program using libpq and ecpglib can not output native language
  In-Reply-To: <4803.1353043336@sss.pgh.pa.us>
  References: <E1TZCv4-0002iN-H0@wrigleys.postgresql.org> <4803.1353043336@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox