11 releases

0.4.3 Mar 31, 2021
0.4.2 Feb 10, 2020
0.4.1 May 24, 2019
0.4.0 Sep 20, 2017
0.3.0 Jun 10, 2016

#52 in Parser implementations

Download history 3902/week @ 2021-06-07 4300/week @ 2021-06-14 4306/week @ 2021-06-21 4155/week @ 2021-06-28 4901/week @ 2021-07-05 5757/week @ 2021-07-12 6501/week @ 2021-07-19 6820/week @ 2021-07-26 8187/week @ 2021-08-02 8713/week @ 2021-08-09 9197/week @ 2021-08-16 8552/week @ 2021-08-23 8083/week @ 2021-08-30 7800/week @ 2021-09-06 7964/week @ 2021-09-13 7770/week @ 2021-09-20

23,271 downloads per month
Used in 56 crates (7 directly)

0BSD license

22KB
431 lines

quoted-printable

Build Status Crate

A quoted-printable decoder and encoder.

API

quoted-printable exposes two 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.

Documentation

See document on https://docs.rs.

No runtime deps