A trait that provides convenience methods for creating a CompactString from a collection of
items. It is implemented for all types that can be converted into an iterator, and that iterator
yields types that can be converted into a str.
Implemented indexing trait for String and str which uses the UnicodeSegmentation facilities to
enable grapheme iteration by default. There could be some performance penalty, but it will allow
for native Unicode support to the best extent possible.
Checks if an input string is already escaped.
The idea is to avoid escaping the escaped string thus making it a nightmare to undo the
escaping later on.
Turn escaped character sequence into the equivalent UTF-8 character
This function accepts \o, \x and \u formats.
This function will also attempt to unescape the common C style control characters.
Anything else needs to be expressed as hex or octal patterns with the formats above.
This function will scan through an escaped string and unescape any escaped characters.
We collect these characters as a byte vector.
Finally, we do a decode pass on the vector to re-encode the bytes hopefully right into a
valid UTF-8 string.