1

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.

Mounika
  • 371
  • 4
  • 18
  • 1
    You were given invalid input. It's up to you how you want to deal with it. Maybe report an error to the caller. Or try to autocorrect the string somehow. Or use the Unicode REPLACEMENT CHARACTER U+FFFD. It's up to you. – Raymond Chen Apr 06 '20 at 03:47

0 Answers0