https://github.com/tornaxo7/rfc2047-decoder
RFC 2047 MIME Message Header decoder Rust library.
https://github.com/tornaxo7/rfc2047-decoder
decoder email library mail mime rfc-2047 rust
Last synced: 2 months ago
JSON representation
RFC 2047 MIME Message Header decoder Rust library.
- Host: GitHub
- URL: https://github.com/tornaxo7/rfc2047-decoder
- Owner: TornaxO7
- License: mit
- Created: 2020-12-27T17:59:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T00:50:19.000Z (3 months ago)
- Last Synced: 2025-03-24T08:29:27.173Z (3 months ago)
- Topics: decoder, email, library, mail, mime, rfc-2047, rust
- Language: Rust
- Homepage:
- Size: 119 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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)