Re: Different locale for pinentry

Klaus Ethgen <[email protected]> Mon, 6 Apr 2026 17:17:01 +0100
Newsgroups gmane.comp.encryption.gpg.user
Message-ID <adPcfWpRQdBB-omB@chil>
Hi Werner,

Am Mo den  6. Apr 2026 um 16:42 schrieb Werner Koch:
> On Mon,  6 Apr 2026 00:35, Klaus Ethgen said:
> 
> > Is there any way to start GUI stuff with UTF-8-locale instead of
> > something else? Alternatively, the whole gpg-agent or any pinentry could
> > be made started with UTF-8.
> 
> The static strings presented by Pinentry (like Counter:/Zähler:) are
> provided by gpg-agent.  Thus the gettext used by gpg-agent is
> responsible for this.  gpg-agent however switches gettext quite early to
> utf-8:
> 
>   /* gpg-agent usually does not output any messages because it runs in
>      the background.  For log files it is acceptable to have messages
>      always encoded in utf-8.  We switch here to utf-8, so that
>      commands like --help still give native messages.  It is far
>      easier to switch only once instead of for every message and it
>      actually helps when more then one thread is active (avoids an
>      extra copy step). */
>     bind_textdomain_codeset (PACKAGE_GT, "UTF-8");
> 
> Thus pinentry sees UTF-8 and depending on the type of pinentry this
> should work.

That is strange as it is definitivelly latin1 what reaches pinentry.

When did that come into the source?

I use gpg-agent on gentoo in version 2.5.17-r2 and my use flags are
alternatives, bzip2, nls, readline, smartcard, ssl, tofu and tools.

> It might be that sme pinentries switch to some native
> encoding depending on $TERM.

See my last post, Thanks to chris I checked that and pinentry does not
care about environment settings.

>   gpg-connect-agent 'getinfo std_env_names' /bye
> 
> gives a list of envvars passed on to Pinentry and are initially set by
> gpg, gpgsm etc.

```
~> gpg-connect-agent 'getinfo std_env_names' /bye
D GPG_TTY
D TERM
D DISPLAY
D XAUTHORITY
D XMODIFIERS
D WAYLAND_DISPLAY
D XDG_SESSION_TYPE
D QT_QPA_PLATFORM
D GTK_IM_MODULE
D DBUS_SESSION_BUS_ADDRESS
D QT_IM_MODULE
D INSIDE_EMACS
D PINENTRY_USER_DATA
D PINENTRY_GEOM_HINT
OK

~/.gnupg> cat gpg-agent.conf
default-cache-ttl 34560000
max-cache-ttl 34560000
log-file /home/klaus/.gnupg/gpg-agent.log
no-allow-external-cache
enable-ssh-support
ssh-fingerprint-digest SHA256
allow-preset-passphrase

grab
#debug-pinentry

# Erst ab Agent 2.1.12
enable-extended-key-format
```

I use pinentry-qt6.

So something is definitivelly wrong here.

Regards
   Klaus

Ps. Gruß aus der Schweiz.
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <[email protected]>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C

_______________________________________________
Gnupg-users mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-users
signature.asc (application/pgp-signature, 728 B)
-----BEGIN PGP SIGNATURE-----
Comment: Charset: ISO-8859-1

iQHPBAABCgA5FiEE2oNkebTd5YKFiBG5fue2cNoeGfgFAmnT3FQbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJEH7ntnDaHhn4sy4L/1Ugnltxs0Sg497cw/+n
Y4bORCIBI9yYMTFrIHCNEhpyL/a7UJ/sdio7COyrz/wUNjeZp5jM0MK0f84N7VQS
eSbAoWpueHgCMvgEKR5CWhPiyvfz1OkITOPSl9jtN+ZZ+sz9xfsAOrus9UQM9yjE
bF0NgelKCYIZDDU1oA4OQE2n9l2lrdDTTf+8F6r2ETlTUZDa5W86l/aaRy6IHXhT
qKyJG5TDLdwmtfqJ3FvK6ZGmSKBCG6Xc4eFrrXUDGh7mF5/Dcj/qvPr8ENUAPJ+B
rCFWNC02ZaVl93mFKlT+ey0oZ+LOPG0+pvYL/2az8z22p4UKXn5/aJmr2CN3qFs7
KgXYWlKKUcVcafWQzheIsV/64yRI8BCsQcwhyPk+oOiWpokBjsKHwsiCxM2YGZws
YCijR1Uc7ofYAyiErBxA57EYZ7yjnRuVLV/Pii3w8gBDcnYhDAzCd4TvYl6YAnIr
AHVFLaRHXdjgFbhb9mB5y5xlAVZn26WN0iej1hj70jKLnw==
=14YW
-----END PGP SIGNATURE-----