Repository navigation
uucore: quoting_style: escape U+2028 and U+2029 like control characters - #15853
vibhuthespeedst wants to merge 2 commits into
Conversation
Merging this PR will degrade performance by 3.47%1 warning, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
ls -b, -Q, -q and shell-escape printed the line and paragraph separators raw, unlike GNU. EscapeOctal now handles characters of any UTF-8 length, since these two take three bytes. Fixes uutils#15745
f9450d0 to
21daa55
Compare
|
|
||
| /// Bytes we need to present as escaped octal, in the form of `\nnn` per byte. | ||
| /// Only supports characters up to 2 bytes long in UTF-8. | ||
| /// Escapes each UTF-8 byte of a character as `\ooo`. |
There was a problem hiding this comment.
this line repeats the one above, could be removed
| } | ||
|
|
||
| #[test] | ||
| fn test_line_and_paragraph_separators() { |
There was a problem hiding this comment.
could you please also add a test in tests/by-util/test_ls.rs with -b and -q? thanks
Also drop a doc comment line that repeated the one above it.
Fixes #15745
ls -b,-Q,-qand--quoting-style=shell-escapeprinted U+2028 and U+2029 raw, because onlychar::is_control()decided what to escape. They are now treated like control characters, which matches GNU (x\342\200\250..for-b,x?..for-q).EscapeOctalonly handled characters up to 2 bytes, since controls never need more. It now handles any UTF-8 length; output for 1 and 2 byte characters is unchanged.Added a test for both characters across the quoting styles.