Code includes an incorrect Unicode escape sequence, or a non-hexadecimal character is the first character in a hexadecimal literal.
Unicode escape sequences begin with \u, followed by exactly four hexadecimal digits. Hexadecimal literals begin with 0x, followed by any number of hexadecimal digits. Hexadecimal digits can contain only the numbers 0-9, the uppercase letters A-F, and the lowercase letters a-f. The following example demonstrates a correctly formed Unicode escape sequence.
В | ![]() |
---|---|
z = "\u1A5F"; |
The following example demonstrates a correctly formed hexadecimal literal.
В | ![]() |
---|---|
k = 0x3E8; |
To correct this error
-
Be sure that hexadecimal numbers contain only the numbers 0-9, the uppercase letters A-F, and the lowercase letters a-f.
-
Be sure that the Unicode escape sequence contains four digits.
Note
If you want to use the literal text \u in a string, then use two backslashes - (\\u) — one to escape the first backslash.