#osstr #path #print #quote #unprintable

no-std uniquote

Quote strings for clear display in output

9 releases (stable)

3.1.1 Jun 15, 2022
3.1.0 Mar 26, 2022
3.0.0 Sep 6, 2021
2.0.0 Dec 27, 2020
0.1.1 May 23, 2020

#27 in Value formatting

Download history 53/week @ 2022-03-10 125/week @ 2022-03-17 112/week @ 2022-03-24 110/week @ 2022-03-31 93/week @ 2022-04-07 92/week @ 2022-04-14 89/week @ 2022-04-21 161/week @ 2022-04-28 138/week @ 2022-05-05 283/week @ 2022-05-12 148/week @ 2022-05-19 243/week @ 2022-05-26 166/week @ 2022-06-02 118/week @ 2022-06-09 161/week @ 2022-06-16 104/week @ 2022-06-23

573 downloads per month
Used in os_str_bytes


547 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 = "3.1"

See the documentation for available functionality and examples.

Rust version support

The minimum supported Rust toolchain version is currently Rust 1.52.0.

Minor version updates may increase this version requirement. However, the previous two Rust releases will always be supported. If the minimum Rust version must not be increased, use a tilde requirement to prevent updating this crate's minor version:

uniquote = "~3.1"


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
  • std