Skip site navigation (1) Skip section navigation (2)

Re: [pgsql-hackers-win32] Win32 & NLS

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>,"pgsql-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] Win32 & NLS
Date: 2004-10-17 19:37:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
>> Test program attached, results below. It returns NULL for
>> whatever I try with LC_MESSAGES.
>It looks like LC_MESSAGES just plain does not work on Windows.  I did
>some googling and found some pages suggesting this, for instance
> s/vclib/html/_crt_setlocale.2c_._wsetlocale.asp

Yes, that's exactly the link I had in my original mail.

> The patch you suggest looks remarkably ugly; in particular it is
> generally unsafe to pass a local variable to putenv.  Perhaps that
> does not matter on Windows but I wonder whether the putenv part
> just be dropped.

I got that from the gettext FAQ. 
The problem is that MSVCRT caches the environment, and that's what you
access using getenv() and putenv(). And this is what gettext uses
internally. The API call is to change the actual process environment.
That's why you need both.

As for the dangers of passing a local variable - there is nothing abot
that in the putenv documentation on MSDN. So I would assume it's safe on

>  And why bother with ZeroMemory?

Oops. that's a leftover from some previous hacking.


pgsql-patches by date

Next:From: Tom LaneDate: 2004-10-17 19:49:25
Subject: Re: strange result from contrib/seg regression on windows
Previous:From: Andrew DunstanDate: 2004-10-17 19:35:10
Subject: strange result from contrib/seg regression on windows

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group