[Pgp-tools-commit] r707 - in trunk: caff gpg-key2ps gpgsigs

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Fri Sep 5 09:34:32 UTC 2014


Author: guilhem-guest
Date: 2014-09-05 09:34:32 +0000 (Fri, 05 Sep 2014)
New Revision: 707

Modified:
   trunk/caff/caff
   trunk/gpg-key2ps/gpg-key2ps
   trunk/gpgsigs/gpgsigs
Log:
Improve handling of escaped characters in gpg's output.

Modified: trunk/caff/caff
===================================================================
--- trunk/caff/caff	2014-09-05 09:34:27 UTC (rev 706)
+++ trunk/caff/caff	2014-09-05 09:34:32 UTC (rev 707)
@@ -1446,6 +1446,7 @@
 				      , hash => $3
 				      , text => $1 eq 'uid' ? $4 : '[attribute]'
 			};
+			$uid->{text} =~ s/\\x(\p{AHex}{2})/ chr(hex($1)) /ge;
 			# --with-colons always outputs UTF-8
 			$uid->{text} = Encode::decode_utf8($uid->{text});
 			push @{$KEYS{$keyid}->{uids}}, $uid;

Modified: trunk/gpg-key2ps/gpg-key2ps
===================================================================
--- trunk/gpg-key2ps/gpg-key2ps	2014-09-05 09:34:27 UTC (rev 706)
+++ trunk/gpg-key2ps/gpg-key2ps	2014-09-05 09:34:32 UTC (rev 707)
@@ -265,7 +265,7 @@
 		$_ = "	($fpr) fpr\n";
 	}
 	# user ids
-	s/\\x([0-9a-f][0-9a-f])/ chr(hex($1)) /gie;
+	s/\\x(\p{AHex}{2})/ chr(hex($1)) /ge;
 	$_ = `echo "$_" | iconv -c -f utf-8 -t latin1`;
 	s/^uid:[^:r]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]*):.*/	($1) uid/;
 	# revoked user id

Modified: trunk/gpgsigs/gpgsigs
===================================================================
--- trunk/gpgsigs/gpgsigs	2014-09-05 09:34:27 UTC (rev 706)
+++ trunk/gpgsigs/gpgsigs	2014-09-05 09:34:32 UTC (rev 707)
@@ -187,8 +187,8 @@
 					$uid = $3; # use the SHA1 to have proper distinction between UIDs/UATs
 					if ($1 eq 'uid') {
 						my $text = $4;
-						$text =~ s/\\x([0-9a-f][0-9a-f])/ chr(hex($1)) /gie;
-						# --with-colons always output UTF-8
+						$text =~ s/\\x(\p{AHex}{2})/ chr(hex($1)) /ge;
+						# --with-colons always outputs UTF-8
 						$uids{$key}->{$uid} = { type => 'uid', text => $locale->encode(Encode::decode_utf8($text)) };
 					}
 					else {




More information about the Pgp-tools-commit mailing list