devxlogo

May 9, 2018

Assuming Char Represents One Character

Do not assume char represents only one character: “uD83DuDC31”.length() == 2 The escape sequence represents the Unicode code point 0x1F431 in UTF-16 as 2 chars. So even though this is