I’m watching ECMA-262 (JavaScript 5 edition) and cannot understand what is “code unit value”?
Can anyone tell me?
Thank you very much!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A JavaScript string is a sequence of unsigned 16-bit integers, also known as code units.
A code point is how the Unicode standard represents symbols and non-symbols. Code points are represented as a four-to-six digit hexadecimal number, typically prefixed with
U+, e.g. U+0061 LATIN SMALL LETTER A.The difference is that what can be part of a code unit depends on the character encoding that is used. A code point however, is merely the concept of a “character” that can then potentially be encoded using UTF-8, for example.
For more information, read chapter 2 of the Unicode spec, especially 2.4 Code points and characters.