summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog2
-rw-r--r--tools/symcryptrun.c35
2 files changed, 5 insertions, 32 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 118a0fe12..9d34e7d62 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,5 +1,7 @@
2007-10-19 Werner Koch <wk@g10code.com>
+ * symcryptrun.c (confucius_get_pass): Use utf8 switching functions.
+
* gpg-connect-agent.c (get_var_ext): New.
(substitute_line): Use it.
(assign_variable): Implement /slet in terms of get_var_ext.
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)
{