fn main() {
assert_eq!(unescaper::unescape(r"\u000a").unwrap(), "\n");
assert_eq!(unescaper::unescape(r"\u{a}").unwrap(), "\n");
assert_eq!(unescaper::unescape(r"\x0a").unwrap(), "\n");
assert_eq!(unescaper::unescape(r"\12").unwrap(), "\n");
}
The idea comes from unescape-rs.
The last commit of that repository was seven years ago.
So, I think it is no longer maintained.
That's why I created this repository, and I have made some improvements.