From 1fe5020558b17a796a7c5d8485256abfb1ab8fc7 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 8 Apr 2009 09:50:48 +0000 Subject: Tell gettext which codeset to use by calling bind_textdomain_codeset(). We already did that on Windows, but it's needed on other platforms too when LC_CTYPE=C. With other locales, we enforce (or trust) that the codeset of the locale matches the server encoding so we don't need to bind it explicitly. It should do no harm in that case either, but I don't have full faith in the PG encoding -> OS codeset mapping table yet. Per recent discussion on pgsql-hackers. --- src/backend/utils/init/postinit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/init/postinit.c') diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 7f2cfdaea0c..44d7dc25247 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.188 2009/02/18 15:58:41 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.189 2009/04/08 09:50:48 heikki Exp $ * * *------------------------------------------------------------------------- @@ -265,6 +265,9 @@ CheckMyDatabase(const char *name, bool am_superuser) SetConfigOption("lc_collate", collate, PGC_INTERNAL, PGC_S_OVERRIDE); SetConfigOption("lc_ctype", ctype, PGC_INTERNAL, PGC_S_OVERRIDE); + /* Use the right encoding in translated messages */ + pg_bind_textdomain_codeset(textdomain(NULL)); + /* * Lastly, set up any database-specific configuration variables. */ -- cgit v1.2.3