mxmlextrema_as3parser/util/
escaping.rs1pub fn escape_xml(characters: &str) -> String {
3 let escaped = htmlentity::entity::encode(characters.as_ref(), &htmlentity::entity::EncodeType::NamedOrHex, &htmlentity::entity::CharacterSet::SpecialChars);
4 String::from_utf8_lossy(&escaped.bytes().into_owned()).into_owned()
5}
6
7pub fn unescape_xml(input: &str) -> String {
9 let unescaped = htmlentity::entity::decode(input.as_ref());
10 String::from_utf8_lossy(&unescaped.bytes().into_owned()).into_owned()
11}