#rfc2047 #mime #header #decoder #decoding

rfc2047-decoder

Rust library for decoding RFC 2047 MIME Message Headers

6 releases

0.2.1 Jan 8, 2023
0.2.0 Oct 11, 2022
0.1.3 Oct 10, 2022
0.1.2 Dec 30, 2020

#46 in Email

Download history 2347/week @ 2022-10-11 2081/week @ 2022-10-18 2965/week @ 2022-10-25 3312/week @ 2022-11-01 2183/week @ 2022-11-08 2733/week @ 2022-11-15 2265/week @ 2022-11-22 2612/week @ 2022-11-29 2229/week @ 2022-12-06 1942/week @ 2022-12-13 1916/week @ 2022-12-20 1592/week @ 2022-12-27 2153/week @ 2023-01-03 2409/week @ 2023-01-10 2102/week @ 2023-01-17 2372/week @ 2023-01-24

9,223 downloads per month
Used in 4 crates (2 directly)

MIT license

28KB
659 lines

rfc2047-decoder Crates.io Crates.io

Rust library for decoding RFC 2047 MIME Message Headers.

use rfc2047_decoder;

fn main() {
    let encoded_str = "=?UTF-8?Q?str?=";
    let decoded_str = "str";

    // using the decode helper (default options)
    assert_eq!(
        rfc2047_decoder::decode(encoded_str.as_bytes()).unwrap(),
        decoded_str
    );

    // using the decoder builder (custom options)
    assert_eq!(
        rfc2047_decoder::Decoder::new()
            .skip_encoded_word_length(true)
            .decode(encoded_str.as_bytes())
            .unwrap(),
        decoded_str
    );
}

Sponsoring

github paypal ko-fi buy-me-a-coffee liberapay

Dependencies

~4.5MB
~148K SLoC