summaryrefslogtreecommitdiffstats
path: root/common/i18n.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/i18n.c')
-rw-r--r--common/i18n.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/i18n.c b/common/i18n.c
index db5ddf5f8..7601cf8bd 100644
--- a/common/i18n.c
+++ b/common/i18n.c
@@ -1,5 +1,5 @@
/* i18n.c - gettext initialization
- * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2010 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -51,8 +51,8 @@ char *
i18n_switchto_utf8 (void)
{
#ifdef USE_SIMPLE_GETTEXT
- gettext_select_utf8 (1);
- return NULL;
+ /* Return an arbitrary pointer as true value. */
+ return gettext_use_utf8 (1) ? (char*)(-1) : NULL;
#elif defined(ENABLE_NLS)
char *orig_codeset = bind_textdomain_codeset (PACKAGE_GT, NULL);
# ifdef HAVE_LANGINFO_CODESET
@@ -82,8 +82,7 @@ void
i18n_switchback (char *saved_codeset)
{
#ifdef USE_SIMPLE_GETTEXT
- (void)saved_codeset;
- gettext_select_utf8 (0);
+ gettext_use_utf8 (!!saved_codeset);
#elif defined(ENABLE_NLS)
if (saved_codeset)
{