aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-08 09:50:48 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-04-08 09:50:48 +0000
commit1fe5020558b17a796a7c5d8485256abfb1ab8fc7 (patch)
tree7fc07de7b8dca3b92efe4c919a03befef2010c4c /src/backend/utils/init/postinit.c
parentbaf048d7d2303b358c3a70495c0eb4939a0ab96a (diff)
downloadpostgresql-1fe5020558b17a796a7c5d8485256abfb1ab8fc7.tar.gz
postgresql-1fe5020558b17a796a7c5d8485256abfb1ab8fc7.zip
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.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c5
1 files changed, 4 insertions, 1 deletions
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.
*/