Charset of gpg --with-colon

David Shaw dshaw@jabberwocky.com
Mon Apr 14 00:49:02 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Apr 13, 2003 at 11:05:57PM +0200, Daniel Luebke wrote:
> Hi!
> 
> I just needed the output of
> 
> gpg --list-keys --with-colon
> 
> I saw that some keynames are printed in UTF-8 and some with a local
> charset. I thought I somewhere read that --with-colon uses UTF-8, but
> maybe I'm wrong.
> What is the correct charset? And why are there keys that are somewhat
> different. And more importantly: How can I correclty get the names ;-)

The name field of --with-colons is the raw UTF-8 value of the user ID
field, with some values \-escaped.

So, to extract the user name you need to take the value from the field
and replace every occurance of '\xQQ' with the byte QQ.  This results
in the UTF-8 name field.

David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2rc1 (GNU/Linux)
Comment: http://www.jabberwocky.com/david/keys.asc

iD8DBQE+mel14mZch0nhy8kRAtvpAKDJFF/yY2v05jFTUVOCWejV4WK9hwCg4ygh
eXQqM6JXWtpqKXe129pBb1U=
=uZZQ
-----END PGP SIGNATURE-----