Re: BUG #4186: set lc_messages does not work

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, "Thomas H(dot)" <me(at)alternize(dot)com>, pgsql-bugs(at)postgresql(dot)org, Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
Subject: Re: BUG #4186: set lc_messages does not work
Date: 2008-12-07 16:48:20
Message-ID: 493BFE54.7050300@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian wrote:
> Tom Lane wrote:
>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>> Thomas H. wrote:
>>>> so at least that explains the "changed" behaviour. nevertheless,
>>>> LC_MESSAGES seems to be defunct - with the "locale" folder present,
>>>> pg always picks the os' language and ignores the lc_message value.
>>> This looks like I can reproduce though, at least on cvs head. Did this
>>> work for you in previous versions?
>> Maybe we were using a different build of gettext in the previous
>> releases, one that didn't look at the same info as the current code?
>>
>> Anyway the patch mentioned at the start of the thread
>> http://archives.postgresql.org/pgsql-patches/2008-02/msg00038.php
>> purports to fix this. It doesn't seem to have gotten reviewed
>> though.
>
> Where are we on this?

Saito-san and I have been working on this item.
The attached patch is for MSVC version and does the following
when built under vc8 or later version MSVC.

1. Accepts Windows or ISO style locale name.
2. _putenv the ISO style locale name as LC_MESSAGES environemnt
variable so as to be referenced by the gettext library.
Note that we have to call _putenv() in msvcrt.dll not in
each MSVC version's runtime library msvcrxx.dll.
3. Calls SetThreadLocale() if necessary.
The currently used libintl3.dll(0.14.4.1592) seems to need
this handling. ISTM it is badly built and ignores the setting
of step 2.

regards,
Hiroshi Inoue

Attachment Content-Type Size
pg_locale.patch text/plain 7.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Regina Obe 2008-12-07 20:34:43 BUG #4567: Clustering on GIST INDEX clobbers records in table intermittently
Previous Message Peter Eisentraut 2008-12-07 08:38:32 Re: BUG #3818: Cross compilation problems

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2008-12-07 17:27:27 Re: user-based query white list
Previous Message Andrew Dunstan 2008-12-07 16:44:08 Re: Mostly Harmless: Welcoming our C++ friends