over on https://bugs.debian.org/795229, anarcat writes:
------
gpg can't seem to operate properly if the environment is not correctly set:
[1007]anarcat@marcos:~$ LANG=C gpg --search-keys ='Antoine Beaupré
<anarcat@koumbit.org>'
gpg: searching for "=Antoine Beaupré <anarcat@koumbit.org>" from hkp server
pool.sks-keyservers.net
gpg: key "=Antoine Beaupré <anarcat@koumbit.org>" not found on keyserver
[1008]anarcat@marcos:~$ LANG=C.UTF-8 gpg --search-keys ='Antoine Beaupré
<anarcat@koumbit.org>'
gpg: searching for "=Antoine Beaupré <anarcat@koumbit.org>" from hkp server
pool.sks-keyservers.net
(1) Antoine Beaupré <anarcat@debian.org>
Antoine Beaupré <anarcat@koumbit.org> Antoine Beaupré <anarcat@orangeseeds.org> Antoine Beaupré (work) <anarcat@koumbit.org> Antoine Beaupré (Debian) <anarcat@debian.org> Antoine Beaupré (home address) <anarcat@anarcat.ath.cx> 4096 bit RSA key 7B75921E, created: 2009-05-29, expires: 2016-06-01
(2) The Anarcat <anarcat@koumbit.org>
The Anarcat <anarcat@anarcat.ath.cx> Antoine Beaupré <antoine@koumbit.org> 1024 bit DSA key 4023702F, created: 2005-03-08, expires: 2010-03-12
(revoked) (expired)
Keys 1-2 of 2 for "=Antoine Beaupré <anarcat@koumbit.org>". Enter number(s),
N)ext, or Q)uit > q
This is pretty annoying, because it expects *everyone* to have a UTF-8
locale. Because my uid has an accent in it, it makes it impossible for
some people to search for my key on the keyservers.
This is also a problem with gpg2:
[1002]anarcat@marcos:~$ LANG=C gpg2 --search-keys ='Antoine Beaupré <a
gpg: searching for "=Antoine Beaupré <anarcat@koumbit.org>" from hkp server po
gpg: key "=Antoine Beaupré <anarcat@koumbit.org>" not found on keyserver
[1003]anarcat@marcos:~$ LANG=C.UTF-8 gpg2 --search-keys ='Antoine Beaupré
<anarcat@koumbit.org>'
gpg: searching for "=Antoine Beaupré <anarcat@koumbit.org>" from hkp server
pool.sks-keyservers.net
(1) Antoine Beaupré <anarcat@debian.org>
Antoine Beaupré <anarcat@koumbit.org> Antoine Beaupré <anarcat@orangeseeds.org> Antoine Beaupré (work) <anarcat@koumbit.org> Antoine Beaupré (Debian) <anarcat@debian.org> Antoine Beaupré (home address) <anarcat@anarcat.ath.cx> 4096 bit RSA key 7B75921E, created: 2009-05-29, expires: 2016-06-01
(2) The Anarcat <anarcat@koumbit.org>
The Anarcat <anarcat@anarcat.ath.cx> Antoine Beaupré <antoine@koumbit.org> 1024 bit DSA key 4023702F, created: 2005-03-08, expires: 2010-03-12
(revoked) (expired)
Keys 1-2 of 2 for "=Antoine Beaupré <anarcat@koumbit.org>". Enter number(s),
N)ext, or Q)uit > q
-----------
i'm not sure what the right fix should be. Even if LANG is broken or a
non-existent locale, can we just marshal the bytes from argv and treat them as a
UTF-8 string?