Junio C Hamano [off-list ref] writes:
Jakub Narebski [off-list ref] writes:
quoted
Use "&iquot;" Latin 1 entity ("¿" -- inverted question mark =
turned question mark, U+00BF ISOnum) instead '?' as replacements for
control characters and other undisplayable characters.
Signed-off-by: Jakub Narebski <redacted>
Do you have something against our Spanish and Latin American
friends? ;-)
I wonder if there is a more suitable replacement character that
is accepted across scripts?
I have a suspicion that instead of finding an exotic character,
just showing the byte value in \octal, perhaps in different
color, might be more portable and easier. For one thing, it
helps to show the exact byte value than just one substitution
character if you are troubleshooting gitweb.
Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Jakub Narebski [off-list ref] writes:
quoted
Use "&iquot;" Latin 1 entity ("¿" -- inverted question mark =
turned question mark, U+00BF ISOnum) instead '?' as replacements for
control characters and other undisplayable characters.
Signed-off-by: Jakub Narebski <redacted>
Do you have something against our Spanish and Latin American
friends? ;-)
I wonder if there is a more suitable replacement character that
is accepted across scripts?
I have a suspicion that instead of finding an exotic character,
just showing the byte value in \octal, perhaps in different
color, might be more portable and easier. For one thing, it
helps to show the exact byte value than just one substitution
character if you are troubleshooting gitweb.
Will do. Well, with the exception of control characters which have
literal escape characters, for example showing LF as \n instead
of \octal. By the way, wouldn't \xhex be better?
Different color/style is good. Otherwise we would have escape escape
character, i.e. write '\\' and perhaps als mark filename as quoted.
git surrounds filename with doublequotes, "<quoted filename>", adding
'"' to the list of quoted characters: for gitweb this kind of marking
filename as quoted is PITA, as we first, don't want I think to include
'"' in link ("_filename_" vs _"filename"_), and second and more important
if we hyperlink parts of filename we would want for quote to be placed
outside whole filename ("a/_filename_" vs a/_"filename"_ and also
"_path_/_to_/_file_" vs _path_/_to_/_"file"_).
Should we mark only replaced character, or the whole filename?
On the technical side, should I send the patch as replacement for this
patch, or on top of this patch?
--
Jakub Narebski
Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Jakub Narebski [off-list ref] writes:
quoted
Use "&iquot;" Latin 1 entity ("¿" -- inverted question mark =
turned question mark, U+00BF ISOnum) instead '?' as replacements for
control characters and other undisplayable characters.
Signed-off-by: Jakub Narebski <redacted>
Do you have something against our Spanish and Latin American
friends? ;-)
I wonder if there is a more suitable replacement character that
is accepted across scripts?
I have a suspicion that instead of finding an exotic character,
just showing the byte value in \octal, perhaps in different
color, might be more portable and easier. For one thing, it
helps to show the exact byte value than just one substitution
character if you are troubleshooting gitweb.
Or perhaps we can use Unicode Control Pictures U+2400 – U+243F
(9216–9279) ("Unicode quoting"):
http://www.alanwood.net/unicode/control_pictures.html
http://www.unicode.org/charts/PDF/U2400.pdf
# quote unsafe characters and escape filename to HTML
sub esc_path {
my $str = shift;
$str = esc_html($str);
$str =~ s!([[:cntrl:]])!sprintf('<span class="cntrl">&#%04d;</span>', 9216+ord($1))!eg;
return $str;
}
with perhaps the following CSS
span.cntrl {
border: dashed #aaaaaa;
border-width: 1px;
padding: 0px 2px 0px 2px;
margin: 0px 2px 0px 2px;
}
What do you think of it?
--
Jakub Narebski