简体   繁体   English

ECMA-262(JavaScript 5版)中的“代码单元值”是什么意思?

[英]What does the “code unit value” mean in ECMA-262 (JavaScript 5 edition)?

I'm watching ECMA-262 (JavaScript 5 edition) and cannot understand what is "code unit value"? 我正在看ECMA-262(JavaScript 5版)并且无法理解什么是“代码单元值”?

Can anyone tell me? 有人能告诉我吗?

Thank you very much! 非常感谢你!

A JavaScript string is a sequence of unsigned 16-bit integers, also known as code units . JavaScript字符串是一系列无符号16位整数,也称为代码单元

A code point is how the Unicode standard represents symbols and non-symbols. 代码点是Unicode标准如何表示符号和非符号。 Code points are represented as a four-to-six digit hexadecimal number, typically prefixed with U+ , eg U+0061 LATIN SMALL LETTER A. 代码点表示为四到六位十六进制数,通常以U+为前缀,例如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. 然而,代码点仅仅是“字符”的概念,然后可以使用例如UTF-8对其进行编码。

For more information, read chapter 2 of the Unicode spec , especially 2.4 Code points and characters . 有关更多信息,请阅读Unicode规范的第2章 ,特别是2.4代码点和字符

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM