From d8c44e5e784dbf7bd371a56a37b8aef7ff3ed59a Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 1 Oct 2008 17:29:58 +0200 Subject: [PATCH] [PATCH] gitweb: Quote non-displayable characters in hex, not octal --- .topdeps | 1 + .topmsg | 11 +++++++++++ gitweb/gitweb.perl | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .topdeps create mode 100644 .topmsg diff --git a/.topdeps b/.topdeps new file mode 100644 index 0000000000..43b8c659cb --- /dev/null +++ b/.topdeps @@ -0,0 +1 @@ +vanilla/master diff --git a/.topmsg b/.topmsg new file mode 100644 index 0000000000..7795ed46b0 --- /dev/null +++ b/.topmsg @@ -0,0 +1,11 @@ +From: Petr Baudis +To: git@vger.kernel.org +Subject: [PATCH] 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 diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index da474d082c..1b5aa14782 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 { -- 2.11.4.GIT