#codec #imap #mailbox #decoder #utf-7 #rfc3501

utf7-imap

Mailbox names encoder and decoder (UTF-7 IMAP RFC 3501)

5 unstable releases

0.3.2 Sep 26, 2022
0.3.1 Sep 17, 2022
0.3.0 Aug 25, 2022
0.2.0 Jan 16, 2022
0.1.0 Nov 26, 2021

#1110 in Encoding

Download history 63/week @ 2023-12-05 86/week @ 2023-12-12 100/week @ 2023-12-19 168/week @ 2023-12-26 88/week @ 2024-01-02 102/week @ 2024-01-09 59/week @ 2024-01-16 67/week @ 2024-01-23 63/week @ 2024-01-30 65/week @ 2024-02-06 77/week @ 2024-02-13 112/week @ 2024-02-20 101/week @ 2024-02-27 80/week @ 2024-03-05 207/week @ 2024-03-12 130/week @ 2024-03-19

529 downloads per month
Used in 4 crates (3 directly)

MIT license

9KB
141 lines

utf7-imap

Test Status Crate API

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.

Usage

Add this to your Cargo.toml:

[dependencies]
utf7-imap = "0.3.2"

Encode

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

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), "Отправленные");

License

utf7-imap is MIT licensed.

Dependencies

~6.5MB
~174K SLoC