Function uucore::display::println_verbatim
source ยท pub fn println_verbatim<S: AsRef<OsStr>>(text: S) -> Result<()>
Expand description
Print a path (or OsStr
-like object) directly to stdout, with a trailing newline,
without losing any information if its encoding is invalid.
This function is appropriate for commands where printing paths is the point and the
output is likely to be captured, like pwd
and basename
. For informational output
use Quotable::quote
.
FIXME: This is lossy on Windows. It could probably be implemented using some low-level API that takes UTF-16, without going through io::Write. This is not a big priority because broken filenames are much rarer on Windows than on Unix.