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 <petr.baudis@novartis.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Petr Baudis 2008-10-01 22:11:54 +02:00 committed by Shawn O. Pearce
parent 5e22e21769
commit 25dfd171d6

View File

@ -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 {