rust/src/librustc_unicode
bors d1df3fecdf Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton
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/
2016-07-28 11:20:33 -07:00
..
Cargo.toml bootstrap: Add a bunch of Cargo.toml files 2016-02-11 11:12:32 -08:00
char.rs Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton 2016-07-28 11:20:33 -07:00
lib.rs Rename char::escape to char::escape_debug and add tracking issue 2016-07-28 02:20:49 +02:00
tables.rs Update Unicode tables to 9.0 2016-07-01 09:46:53 -07:00
u_str.rs run rustfmt on librustc_unicode 2016-06-05 23:30:11 +05:30