d1df3fecdf
Escape fewer Unicode codepoints in `Debug` impl of `str` Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` `0x20` This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/ |
||
---|---|---|
.. | ||
collections | ||
ffi | ||
io | ||
net | ||
num | ||
os | ||
prelude | ||
rand | ||
sync | ||
sys | ||
thread | ||
time | ||
ascii.rs | ||
build.rs | ||
Cargo.toml | ||
env.rs | ||
error.rs | ||
fs.rs | ||
lib.rs | ||
macros.rs | ||
memchr.rs | ||
panic.rs | ||
panicking.rs | ||
path.rs | ||
primitive_docs.rs | ||
process.rs | ||
rt.rs | ||
rtdeps.rs |