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

setlocale and gettext in Postgres

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: setlocale and gettext in Postgres
Date: 2011-01-27 13:03:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi all,

I see now the following lines in libintl.h of version which didn't exist in 0.17 version.

/* Support for the locale chosen by the user.  */
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined
__WIN32__ || defined __CYGWIN__

#undef setlocale
#define setlocale libintl_setlocale
extern char *setlocale (int, const char *);

The macro may cause a trouble especially on Windows.

Though libintl_setlocale() calls setlocale() internally,
what the Mingw version of libintl library calls is the one
in msvcrt.dll not in the libraries which main programs link.
Unfortunately locale-aware functions like printf() calls
in main programs would see "C" locales not the locales set
by libintl_setlocale().

Attached is a patch to disable the macro on Windows.

Hiroshi Inoue

Attachment: port.h.diff
Description: text/plain (506 bytes)


pgsql-hackers by date

Next:From: Fujii MasaoDate: 2011-01-27 13:15:44
Subject: Re: Allowing multiple concurrent base backups
Previous:From: Heikki LinnakangasDate: 2011-01-27 12:38:32
Subject: COPYRIGHT vs psql \copyright

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