use unicode_normalization::UnicodeNormalization;
pub fn decode_chain(input: &str) -> String {
let s1 = decode_percent(input);
let s2 = decode_html(&s1);
let s3 = decode_base64(&s2);
normalize_unicode(&s3)
}
fn decode_percent(input: &str) -> String {
percent_encoding::percent_decode_str(input)
.decode_utf8_lossy()
.into_owned()
}
fn decode_html(input: &str) -> String {
html_escape::decode_html_entities(input).into_owned()
}
fn decode_base64(input: &str) -> String {
match data_encoding::BASE64.decode(input.as_bytes()) {
Ok(bytes) => String::from_utf8_lossy(&bytes).into_owned(),
Err(_) => input.to_string(),
}
}
fn normalize_unicode(input: &str) -> String {
input.nfkc().collect()
}