#header #mime #decoding #decoder #rfc2047

rfc2047-decoder

Rust library for decoding RFC 2047 MIME Message Headers

12 releases (5 stable)

1.0.6 Nov 11, 2024
1.0.5 Feb 11, 2024
1.0.2 Dec 16, 2023
1.0.1 Sep 17, 2023
0.1.2 Dec 30, 2020

#11 in Email

Download history 15419/week @ 2024-07-30 15153/week @ 2024-08-06 15959/week @ 2024-08-13 18955/week @ 2024-08-20 17595/week @ 2024-08-27 20524/week @ 2024-09-03 18658/week @ 2024-09-10 16381/week @ 2024-09-17 19267/week @ 2024-09-24 14770/week @ 2024-10-01 19295/week @ 2024-10-08 20039/week @ 2024-10-15 15626/week @ 2024-10-22 15405/week @ 2024-10-29 16583/week @ 2024-11-05 15836/week @ 2024-11-12

66,626 downloads per month
Used in 18 crates (5 directly)

MIT license

39KB
739 lines

rfc2047-decoder Crates.io Crates.io

State

This project is considered as finished, only bugs will be fixed so don't wonder, if the last commit is a long time ago.

Introduction

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()
            .too_long_encoded_word_strategy(rfc2047_decoder::RecoverStrategy::Skip)
            .decode(encoded_str.as_bytes())
            .unwrap(),
        decoded_str
    );
}

Sponsoring

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

Dependencies

~7MB
~178K SLoC