mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
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:
parent
5e22e21769
commit
25dfd171d6
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user