Crates.io | utf7-imap |
lib.rs | utf7-imap |
version | 0.3.2 |
source | src |
created_at | 2021-11-26 06:08:36.42838 |
updated_at | 2022-09-26 06:44:35.773846 |
description | Mailbox names encoder and decoder (UTF-7 IMAP RFC 3501) |
homepage | https://github.com/iam-medvedev/rust-utf7-imap |
repository | https://github.com/iam-medvedev/rust-utf7-imap |
max_upload_size | |
id | 487924 |
size | 11,015 |
A Rust library for encoding and decoding UTF-7 string as defined by the IMAP standard in RFC 3501 (#5.1.3).
Idea is based on Python mutf7 library.
Add this to your Cargo.toml
:
[dependencies]
utf7-imap = "0.3.2"
Encode UTF-7 IMAP mailbox name
https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3
use utf7_imap::encode_utf7_imap;
let test_string = String::from("Отправленные");
assert_eq!(utf7_imap::encode_utf7_imap(test_string), "&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-");
Decode UTF-7 IMAP mailbox name https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3
use utf7_imap::decode_utf7_imap;
let test_string = String::from("&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-");
assert_eq!(decode_utf7_imap(test_string), "Отправленные");
utf7-imap is MIT licensed.