16 releases

0.5.0 Jun 23, 2023
0.4.7 Feb 1, 2023
0.4.6 Dec 1, 2022
0.4.5 Nov 26, 2021
0.3.0 Jun 10, 2016

#84 in Parser implementations

Download history 32270/week @ 2023-12-13 26776/week @ 2023-12-20 24261/week @ 2023-12-27 32554/week @ 2024-01-03 36061/week @ 2024-01-10 37331/week @ 2024-01-17 35383/week @ 2024-01-24 38806/week @ 2024-01-31 37863/week @ 2024-02-07 38732/week @ 2024-02-14 44258/week @ 2024-02-21 54321/week @ 2024-02-28 67693/week @ 2024-03-06 48404/week @ 2024-03-13 51090/week @ 2024-03-20 38738/week @ 2024-03-27

218,880 downloads per month
Used in 150 crates (17 directly)

0BSD license

33KB
619 lines

quoted-printable

Build Status Crate

A quoted-printable decoder and encoder.

API

quoted-printable exposes three functions at the moment:

    decode<R: AsRef<[u8]>>(input: R, mode: ParseMode) -> Result<Vec<u8>, QuotedPrintableError>
    encode<R: AsRef<[u8]>>(input: R) -> Vec<u8>
    encode_to_str<R: AsRef<[u8]>>(input: R) -> String

using R: AsRef<[u8]> means that you can pass in a variety of types, including: String, &String, &str, Vec<u8>, &Vec<u8>, &[u8], Box<[u8]>, Arc<[u8]>

The decode function can be used to convert a quoted-printable string into the decoded bytes, as per the description in IETF RFC 2045, section 6.7. The ParseMode option can be used to control whether the decoding is "strict" or "robust", as per the comments in that RFC. In general you should probably use "robust" decoding, as it will gracefully handle more malformed input.

The encode and encode_to_str functions obviously do the reverse, and convert a set of raw bytes into quoted-printable.

no_std

This crate supports no_std. By default the crate targets std via the std feature. You can deactivate the default-features to support no_std like this:

quoted-printable = { version = "*", default-features = false }

Documentation

See document on https://docs.rs.

No runtime deps

Features