diff options
author | Werner Koch <wk@gnupg.org> | 2008-04-18 11:20:25 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-04-18 11:20:25 +0200 |
commit | 4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7 (patch) | |
tree | fb2741341342ef10c52ef1f345eef45eda8defe0 /common | |
parent | Test commit (diff) | |
download | gnupg2-4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7.tar.xz gnupg2-4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7.zip |
Adjust for the changed Camellia draft.
W32 gettext changes.
Comment and typo fixes.
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 5 | ||||
-rw-r--r-- | common/i18n.c | 14 |
2 files changed, 14 insertions, 5 deletions
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 <wk@g10code.com> + + * i18n.c (i18n_switchto_utf8, i18n_switchback) + [USE_SIMPLE_GETTEXT]: Implement. + 2008-04-07 Werner Koch <wk@g10code.com> * 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); |