From c12ce55b25685738bc1668df7b7bde87c4ba023c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 19 Oct 2007 15:58:38 +0000 Subject: Factored utf8 switching code out to i18n.c. --- tools/symcryptrun.c | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'tools/symcryptrun.c') diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c index fced86fb7..e720eab2f 100644 --- a/tools/symcryptrun.c +++ b/tools/symcryptrun.c @@ -424,46 +424,17 @@ confucius_get_pass (const char *cacheid, int again, int *canceled) { int err; char *pw; -#ifdef ENABLE_NLS - char *orig_codeset = NULL; -#endif + char *orig_codeset; if (canceled) *canceled = 0; -#ifdef ENABLE_NLS - /* The Assuan agent protocol requires us to transmit utf-8 strings */ - orig_codeset = bind_textdomain_codeset (PACKAGE_GT, NULL); -#ifdef HAVE_LANGINFO_CODESET - if (!orig_codeset) - orig_codeset = nl_langinfo (CODESET); -#endif - if (orig_codeset && !strcmp (orig_codeset, "UTF-8")) - orig_codeset = NULL; - if (orig_codeset) - { - /* We only switch when we are able to restore the codeset later. */ - orig_codeset = xstrdup (orig_codeset); - if (!bind_textdomain_codeset (PACKAGE_GT, "utf-8")) - { - xfree (orig_codeset); - orig_codeset = NULL; - } - } -#endif - + orig_codeset = i18n_switchto_utf8 (); pw = simple_pwquery (cacheid, again ? _("does not match - try again"):NULL, _("Passphrase:"), NULL, 0, &err); err = map_spwq_error (err); - -#ifdef ENABLE_NLS - if (orig_codeset) - { - bind_textdomain_codeset (PACKAGE_GT, orig_codeset); - xfree (orig_codeset); - } -#endif + i18n_switchback (orig_codeset); if (!pw) { -- cgit v1.2.3