Different locale for pinentry

Klaus Ethgen klaus+gnupg at ethgen.ch
Mon Apr 6 18:17:01 CEST 2026


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 <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/03719f61/attachment.sig>


More information about the Gnupg-users mailing list