Re: Win32 & NLS - Mailing list pgsql-patches

From Magnus Hagander
Subject Re: Win32 & NLS
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE456A23@algol.sollentuna.se
Whole thread Raw
In response to Win32 & NLS  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-patches
>> Which appears to suggest that we should change the locale using
>> putenv() etc, and not using setlocale() at all... Because setlocale()
>> does not support LC_MESSAGES, probably.
>
>This cannot possibly work.  putenv() doesn't change any locale.  The
>environment variables only serve as a default when you call
>setlocale()
>without an actual locale value.  But to enable any locale, you always
>need to call setlocale() somehow, somewhere.

That was my first thought, too. But it *does* appear to work.

With this patch, I can change lc_messages from
environment-before-startup, from postgresql.conf or using "set
lc_messages='foo'".
The only main thing I see as being wrong is that it cannot check if the
specified messages were incorrect. If I literally set it to "foo", I get
english without getting any error/warning.

Clearly they don't just serve as defaults on win32. That's the only
conclusion I can draw from the fact that this works, and from the
questions in the FAQ referenced.

See also for example
http://lists.gnu.org/archive/html/bug-gnu-utils/2004-02/msg00091.html


//Magnus

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Win32 & NLS
Next
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] Win32 & NLS