393. UTF-8 Validation
Char. number range | UTF-8 octet sequence
(hexadecimal) | (binary)
--------------------+---------------------------------------------
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxxdata = [197, 130, 1], which represents the octet sequence:
11000101 10000010 00000001
.
Return
true
.
It is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character.Last updated
Was this helpful?