Rust Requires Chilkat v11.1.0+
Rust
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Rust Downloads
let crypt = chilkat::Crypt2::new();
let mut s = "< é ü ç Ω Hello & World ✓ >".to_string();
let html_encoded = crypt.encode_string(&s, "utf-8", "html").unwrap_or_default();
println!("{}", html_encoded);
// Output:
// < é ü ç Ω Hello & World ✓ >
// To decode:
s = crypt.decode_string(&html_encoded, "utf-8", "html").unwrap_or_default();
println!("{}", s);
// Output:
// < é ü ç Ω Hello & World ✓ >