UTF-16 surrogate pair fix

Handle UTF-16 surrogate pair conversion to/from UTF-8