From 4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 18 Apr 2008 09:20:25 +0000 Subject: Adjust for the changed Camellia draft. W32 gettext changes. Comment and typo fixes. --- common/ChangeLog | 5 +++++ common/i18n.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/ChangeLog b/common/ChangeLog index ab68709cc..3cc542682 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,8 @@ +2008-04-08 Werner Koch + + * i18n.c (i18n_switchto_utf8, i18n_switchback) + [USE_SIMPLE_GETTEXT]: Implement. + 2008-04-07 Werner Koch * b64enc.c (b64enc_start): Detect PGP mode. diff --git a/common/i18n.c b/common/i18n.c index c13be8608..7ed4bb4de 100644 --- a/common/i18n.c +++ b/common/i18n.c @@ -45,17 +45,19 @@ i18n_init (void) /* The Assuan agent protocol requires us to transmit utf-8 strings - thus we need a fuctnion to temporary switch gettext from native to + thus we need a way to temporary switch gettext from native to utf8. */ char * i18n_switchto_utf8 (void) { -#ifdef ENABLE_NLS +#ifdef USE_SIMPLE_GETTEXT + gettext_select_utf8 (1); +#elif define(ENABLE_NLS) char *orig_codeset = bind_textdomain_codeset (PACKAGE_GT, NULL); -#ifdef HAVE_LANGINFO_CODESET +# ifdef HAVE_LANGINFO_CODESET if (!orig_codeset) orig_codeset = nl_langinfo (CODESET); -#endif +# endif if (orig_codeset) { /* We only switch when we are able to restore the codeset later. Note that bind_textdomain_codeset does only return on memory @@ -78,7 +80,9 @@ i18n_switchto_utf8 (void) void i18n_switchback (char *saved_codeset) { -#ifdef ENABLE_NLS +#ifdef USE_SIMPLE_GETTEXT + gettext_select_utf8 (0); +#elif defined(ENABLE_NLS) if (saved_codeset) { bind_textdomain_codeset (PACKAGE_GT, saved_codeset); -- cgit v1.2.3