Implement Debug
for EncodeWide
by thaliaarchi · Pull Request #140153 · rust-lang/rust (original) (raw)
Here are the options, as I see them. I think formatting them as chars when not surrogates is the most readable for most texts. Rust style seems to lean towards uppercase hex.
EncodeWide([97, 233, 32, 55357, 55357, 56489])
: decimalEncodeWide([0x61, 0xE9, 0x20, 0xD83D, 0xD83D, 0xDCA9])
: hex, zero-pad min 2, upperEncodeWide([0x61, 0xe9, 0x20, 0xd83d, 0xd83d, 0xdca9])
: hex, zero-pad min 2, lowerEncodeWide([0x0061, 0x00E9, 0x0020, 0xD83D, 0xD83D, 0xDCA9])
: hex, zero-pad min 4, upperEncodeWide([0x0061, 0x00e9, 0x0020, 0xd83d, 0xd83d, 0xdca9])
: hex, zero-pad min 4, lowerEncodeWide(['a', 'é', ' ', '\u{D83D}', '\u{D83D}', '\u{DCA9}'])
: pseudo-char, escaped surrogates, upperEncodeWide(['a', 'é', ' ', '\u{d83d}', '\u{d83d}', '\u{dca9}'])
: pseudo-char, escaped surrogates, lower