Conversion of UTF16 to UTF32 - Invalid surrogate pair

355 Views Asked by At

While converting an array of UTF16 to UTF32, if I come across a high surrogate and if the next value is neither a high surrogate nor a low surrogate, should we invalidate both the values in UTF16 array? or

Should we invalidate just the high surrogate and proceed with the conversion of next value?

Reference: https://unicodebook.readthedocs.io/unicode_encodings.html#surrogates

Thanks.

0

There are 0 best solutions below