6 releases (3 breaking)
|0.4.2||Dec 7, 2020|
|0.4.1||Oct 22, 2020|
|0.3.1||Jun 25, 2020|
|0.2.0||Apr 22, 2020|
|0.1.0||Apr 4, 2020|
#81 in Operating systems
170 downloads per month
Used in 2 crates
This crate allows printing broken UTF-8 bytes to an output stream as losslessly as possible.
Usually, paths are printed by calling
Path::to_string_lossy beforehand. However, both of these methods are always
lossy; they misrepresent some valid paths in output. The same is true when
String::from_utf8_lossy to print any other UTF-8–like byte sequence.
Instead, this crate only performs a lossy conversion when the output device is
known to require unicode, to make output as accurate as possible. When
necessary, any character sequence that cannot be represented will be replaced
REPLACEMENT_CHARACTER. That convention is shared with the standard
library, which uses the same character for its lossy conversion functions.
Add the following lines to your "Cargo.toml" file:
[dependencies] print_bytes = "0.4"
See the documentation for available functionality and examples.
The minimum supported Rust toolchain version is currently Rust 1.36.0.
However, the "min_const_generics" and "specialization" features require a nightly compiler.
Licensing terms are specified in COPYRIGHT.
Unless you explicitly state otherwise, any contribution submitted for inclusion in this crate, as defined in LICENSE-APACHE, shall be licensed according to COPYRIGHT, without any additional terms or conditions.