Skip to main content

utf7_decode

Function utf7_decode 

Source
pub fn utf7_decode(s: &str) -> Option<String>
Expand description

Decode UTF-7 (RFC 2152) — the inverse of utf7_encode, i.e. exactly what a UTF-7-honoring backend computes. + opens a shift sequence of modified-Base64 carrying UTF-16BE code units, terminated by - (absorbed) or any non-Base64 byte (kept); +- is a literal +; every other byte passes through. Returns None on malformed Base64, an odd UTF-16 byte count, or unpaired surrogates — so a caller proving round-trip soundness treats undecodable input as “not recoverable” rather than guess.