зеркало из https://github.com/microsoft/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 <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Родитель
5e22e21769
Коммит
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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче