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

From chenhj@cn.fujitsu.com
Subject BUG #7664: Program using libpq and ecpglib can not output native language
Date
Msg-id E1TZCv4-0002iN-H0@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #7664: Program using libpq and ecpglib can not output native language  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: Re: BUG #7651: Superfluous calls to functions used for indexing
Next
From: Stuart Bishop
Date:
Subject: Re: BUG #7651: Superfluous calls to functions used for indexing