#osstr #path #print #quote #unprintable

no-std uniquote

Quote strings for clear display in output

6 releases (stable)

2.0.0 Dec 27, 2020
1.1.1 Oct 29, 2020
1.0.0 Jun 13, 2020
0.1.1 May 23, 2020

#42 in Value formatting

48 downloads per month


531 lines


This crate allows quoting strings for use in output. It works similarly to str::escape_debug, but the result is meant to be shown to users. Simply call Quote::quote on an argument passed to println! or a similar macro to quote it.

One of the primary uses for this crate is displaying paths losslessly. Since Path has no Display implementation, it is usually output by calling Path::display or Path::to_string_lossy beforehand. However, both of those methods are lossy; they replace all invalid characters with REPLACEMENT_CHARACTER. This crate escapes those invalid characters instead, allowing them to always be displayed correctly.

GitHub Build Status


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

uniquote = "2.0"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.37.0.

However, the "min_const_generics" feature requires 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.

No runtime deps


  • alloc
  • min_const_generics
  • std