Closed
Description
OsStr
implements fmt::Debug
:
- On Unix, using
to_lossy_str
, thenfmt::Debug::fmt
on the resultingString
, 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