diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-06-26 15:11:48 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-07-23 00:18:44 +0200 |
| commit | e7d16580f5856ecb0c515c7cdcabd2c10ba91547 (patch) | |
| tree | 68359f4a107dc3d3c2fbc21d17e4ad006688f4c5 /src/rustllvm/RustWrapper.cpp | |
| parent | ad264f7f39b6113fb87a489d72d31abbc03ab148 (diff) | |
| download | rust-e7d16580f5856ecb0c515c7cdcabd2c10ba91547.tar.gz rust-e7d16580f5856ecb0c515c7cdcabd2c10ba91547.zip | |
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.
[PEP 3138]: https://www.python.org/dev/peps/pep-3138/
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
