Skip to content

Commit 25dfd17

Browse files
Petr Baudisspearce
authored andcommitted
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>
1 parent 5e22e21 commit 25dfd17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitweb/gitweb.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ sub quot_cec {
775775
);
776776
my $chr = ( (exists $es{$cntrl})
777777
? $es{$cntrl}
778-
: sprintf('\%03o', ord($cntrl)) );
778+
: sprintf('\%2x', ord($cntrl)) );
779779
if ($opts{-nohtml}) {
780780
return $chr;
781781
} else {

0 commit comments

Comments
 (0)