pub fn encode(s: &str, w: &mut EmailWriter<'_>) -> Result
Expand description

Encode a string via RFC 2047.

Examples

let input = "Adrián";

let mut output = String::new();
let mut writer = EmailWriter::new(&mut output, 0, false);
email_encoding::headers::rfc2047::encode(input, &mut writer)?;
assert_eq!(output, "=?utf-8?b?QWRyacOhbg==?=");