Crates.io | snailquote |
lib.rs | snailquote |
version | 0.3.1 |
source | src |
created_at | 2018-07-13 21:23:15.662418 |
updated_at | 2021-10-28 05:03:41.331532 |
description | Escape and unescape strings with shell-inspired quoting |
homepage | https://github.com/euank/snailquote |
repository | https://github.com/euank/snailquote |
max_upload_size | |
id | 74110 |
size | 59,070 |
This library provides functions to escape and unescape strings.
It escapes them in a roughly 'sh' compatible way (e.g. double quotes supporting backslash escapes, single quotes supporting no escapes).
In addition, it provides support for common c-like ascii escapes (like \n
for
newline, \v
for vertical tab, etc) and rust-string-like unicode (via
\u{12ff}
style escapes).
More importantly, this library also provides the ability to un-escape a given escaped text to recover the original string.
For more information on usage and what escape sequences will work, see the docs.
snailquote intends to explicitly be compatible with the following use-cases:
os-release
files.Other files may have a similar shell-inspired format that snailescape works with, but it's up to you to verify it really is similar enough to be correct.
snailquote is inspired by, but not compatible with, the following:
Other libraries in rust I've found have one or more of the following problems: