Different locale for pinentry

Klaus Ethgen klaus+gnupg at ethgen.ch
Mon Apr 6 19:32:51 CEST 2026


By the way, I checked the log file that should have utf8 strings but
there is latin1: "command 'PKDECRYPT' failed: Kein geheimer Schlüssel"
(see the "ü").

So for some reasons, that switch to utf8 is not working or reverted.

I do not know the code good enough, but I checked and found some
i18n_switchto_utf8/i18n_switchback somewhere in he gpg-agent dir.
However, that looks quite reasonable for me.

The only difference I find is that all the code uses "utf-8" but
gpg-agent uses "UTF-8". Could it be that this codeset is case sensitive?

You even have the following comment:
      { /* We only switch when we are able to restore the codeset later.
           Note that bind_textdomain_codeset does only return on memory
           errors but not if a codeset is not available.  Thus we don't
           bother printing a diagnostic here. */

So I am afraid that it is just ignoring that UTF-8. But I would not bet
for it.

Would it be possible to check after setting it if the codeset is equal?

Something like:
char *orig_codeset = bind_textdomain_codeset(PACKAGE_GT, NULL);
if (!strcmp(orig_codeset, "UTF-8"))
{
   log_info(_("WARNING: \"%s\" is not equal to UTF-8\n"), orig_codeset);
}

Regards
   Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <Klaus at Ethgen.ch>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 728 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20260406/595a675f/attachment.sig>


More information about the Gnupg-users mailing list