Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iam-medvedev/rust-utf7-imap
Mailbox names decoder (UTF-7 IMAP RFC3501)
https://github.com/iam-medvedev/rust-utf7-imap
Last synced: 3 months ago
JSON representation
Mailbox names decoder (UTF-7 IMAP RFC3501)
- Host: GitHub
- URL: https://github.com/iam-medvedev/rust-utf7-imap
- Owner: iam-medvedev
- License: mit
- Created: 2021-11-25T20:15:52.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-26T06:40:48.000Z (over 2 years ago)
- Last Synced: 2024-09-16T00:31:11.422Z (4 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/utf7-imap
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# utf7-imap
[![Test Status](https://github.com/iam-medvedev/rust-utf7-imap/workflows/test/badge.svg?event=push)](https://github.com/iam-medvedev/rust-utf7-imap/actions)
[![Crate](https://img.shields.io/crates/v/utf7-imap.svg?color=green)](https://crates.io/crates/utf7-imap)
[![API](https://docs.rs/utf7-imap/badge.svg)](https://docs.rs/utf7-imap)A Rust library for encoding and decoding [UTF-7](https://datatracker.ietf.org/doc/html/rfc2152) string as defined by the [IMAP](https://datatracker.ietf.org/doc/html/rfc3501) standard in [RFC 3501 (#5.1.3)](https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3).
Idea is based on Python [mutf7](https://github.com/cheshire-mouse/mutf7) library.
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
utf7-imap = "0.3.2"
```### Encode
Encode UTF-7 IMAP mailbox name
```rust
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
```rust
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](LICENSE).