chunked: fix escape of space#1895
Conversation
the code was copied from the composefs C version:
if (noescape_space)
hex_escape = !isprint(c);
else
hex_escape = !isgraph(c);
but unicode.IsGraphic() seems to behave differently and includes the
space:
isgraph(' ') -> 0
unicode.IsGraphic(' ') -> true
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
@rhatdan this is the fix for the |
kolyshkin
left a comment
There was a problem hiding this comment.
Indeed, `isgraph(3) says (emphasis is mine):
isgraph() checks for any printable character **except space**.
and unicode.IsGraphic says:
IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories L, M, N, P, S, Zs.
Somewhat ironic that the test case was obv. wrong.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, kolyshkin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/ljtm |
|
/lgtm |
the code was copied from the composefs C version:
but unicode.IsGraphic() seems to behave differently and includes the space:
isgraph(' ') -> 0
unicode.IsGraphic(' ') -> true