[][src]Module binjs_io::escaped_wtf8

Functions

escape

If the given bytes is WTF-8 which contains lone surrogate, escape the lone surrogate with \x7F + XXXX (4 hex digits) and return the byte array. If not, return the given bytes.

from_unicode_escape

If the given bytes contains any unicode escape \uXXXX and that is lone surrogate, convert it to escaped lone surropgate.

to_unicode_escape

If the given bytes contains any escaped lone surropgate, convert it to unicode escape \uXXXX.

unescape

If the given bytes contains any escaped lone surropgate, unescape all escaped lone surrogate and returns the byte array. If not, return None.