1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# rfc2047-decoder [](https://crates.io/crates/rfc2047-decoder) [](https://crates.io/crates/rfc2047-decoder)
# 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](https://tools.ietf.org/html/rfc2047).
```rust
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
[](https://github.com/sponsors/soywod)
[](https://www.paypal.com/paypalme/soywod)
[](https://ko-fi.com/soywod)
[](https://www.buymeacoffee.com/soywod)
[](https://liberapay.com/soywod)
|