OsStr implements fmt::Debug:
- On Unix, using
to_lossy_str, then fmt::Debug::fmt on the resulting String, which escapes all control or non-ASCII characters.
- On Windows, it eventually calls an
impl I originally wrote for rust-wft8, which is lossless but only escapes surrogate code points. In particular, it happily prints control characters.
So there are two issues: they should be consistent across platforms, and is it OK for a Debug impl to be lossy?
CC @aturon, @alexcrichton
OsStrimplementsfmt::Debug:to_lossy_str, thenfmt::Debug::fmton the resultingString, which escapes all control or non-ASCII characters.implI originally wrote for rust-wft8, which is lossless but only escapes surrogate code points. In particular, it happily prints control characters.So there are two issues: they should be consistent across platforms, and is it OK for a
Debugimpl to be lossy?CC @aturon, @alexcrichton