locale bug in 1.4

Hauke Laging mailinglisten at hauke-laging.de
Mon Mar 17 05:28:28 CET 2014


Hello,

I may have found a locale bug in 1.4.12. I am aware that this is not the 
current version but I cannot easily install 1.4.16 now. 1.4.12 is the 
version in Knoppix 7.2.

I have problems with non-ASCII characters when I use batch mode. The 
funny part is that this problem does not appear when I generate a 
mainkey (from a batch config file). It appears when I add UIDs later:

echo adduid$'\n'"$name"$'\n'"${email}"$'\n'"${comment}"$'\n'save$'\n' | 
  LC_ALL= LANGUAGE=en gpg --batch --passphrase foo \
  --command-fd 0 --edit-key Hauke

The man page says about --display-charset:
"If this option is not used, the default character set is determined 
from the current locale."
What you would expect.

locale looks like this:

LANG=de_DE.UTF-8
LANGUAGE=de
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"

gpg --expert --gen-key

leads to a message:
"You are using the `utf-8` character set."

The batch pipeline leads to:
"You are using the `iso-8859-1` character set."
Which IMHO pretty well explains the umlaut problems. But it doesn't make 
sense to me. Why does GnuPG guess it's not UTF-8 any more just because 
of the pipeline? Adding --display-charset utf-8 solves the problem. It 
does not occur with 2.0.22 (and some versions before).


BTW: Unfortunately I have no clue about internationalization. Is it 
correct that LANG and all the LC_ variables have content of this kind 
LANG=de_DE.UTF-8 but that LANGUAGE has neither the _ part nor a 
character encoding?


Hauke
-- 
Crypto für alle: http://www.openpgp-schulungen.de/fuer/unterstuetzer/
http://userbase.kde.org/Concepts/OpenPGP_Help_Spread
OpenPGP: 7D82 FB9F D25A 2CE4 5241 6C37 BF4B 8EEF 1A57 1DF5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/attachments/20140317/dab322a6/attachment.sig>


More information about the Gnupg-users mailing list