fix parsing of UTF-16 surrogate pairs