From: Petr Baudis Date: Wed, 1 Oct 2008 20:11:54 +0000 (+0200) Subject: gitweb: Quote non-displayable characters in hex, not octal X-Git-Tag: v1.6.1-rc1~185 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=25dfd171d646c38f9344d8e3d8ae0fdf179dd281;p=git.git gitweb: Quote non-displayable characters in hex, not octal For the last 30 years, the mankind uses the octal representation of characters only in rare cases and most character codes are hardly recognizable in octal. In contrast, many programmers still know hexadecimal well and that is also the representation of choice e.g. for Unicode codepoints. Signed-off-by: Petr Baudis Signed-off-by: Shawn O. Pearce --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 18e70a366..eb2943a53 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -775,7 +775,7 @@ sub quot_cec { ); my $chr = ( (exists $es{$cntrl}) ? $es{$cntrl} - : sprintf('\%03o', ord($cntrl)) ); + : sprintf('\%2x', ord($cntrl)) ); if ($opts{-nohtml}) { return $chr; } else {