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

2012-11-16 Thread Chen Huajun
> No, not particularly. The C language standard is quite clear about > that. Nor does it seem like a particularly great idea from a user's > standpoint for different sub-parts of a program to be operating in > different locales. Even if I agreed with the concept, your idea of > switching locale

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

2012-11-16 Thread Tom Lane
Chen Huajun writes: > First,does you agree with the need of native language support without writin > "setlocale(LC_ALL, "")"in user's program is rational? No, not particularly. The C language standard is quite clear about that. Nor does it seem like a particularly great idea from a user's stand

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

2012-11-16 Thread Chen Huajun
Hi,tom lane > 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. First,does you agree with the need of native language

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

2012-11-15 Thread Tom Lane
che...@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 eas

[BUGS] BUG #7664: Program using libpq and ecpglib can not output native language

2012-11-15 Thread chenhj
The following bug has been logged on the website: Bug reference: 7664 Logged by: Chen Huajun Email address: che...@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