print_bytes 0.4.1

Print bytes as losslessly as possible
docs.rs failed to build print_bytes-0.4.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: print_bytes-2.0.0

print_bytes

This crate allows printing broken UTF-8 bytes to an output stream as losslessly as possible.

Usually, paths are printed by calling Path::display or 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 using 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 with REPLACEMENT_CHARACTER. That convention is shared with the standard library, which uses the same character for its lossy conversion functions.

GitHub Build Status

Usage

Add the following lines to your "Cargo.toml" file:

[dependencies]
print_bytes = "0.4"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.36.0.

However, the "min_const_generics" and "specialization" features require a nightly compiler.

License

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.