gpt4 book ai didi

java - java中原始类型char的值指的是哪个Unicode表?

转载 作者:行者123 更新时间:2023-11-29 07:48:53 25 4
gpt4 key购买 nike

想在java中查找原始类型char的值的编码表,听说java内部使用Unicode。 java中原始类型char的值指的是哪个Unicode表?

最佳答案

the Oracle documentation 中所述:

When the specification for the Java language was created, the Unicodestandard was accepted and the char primitive was defined as a 16-bitdata type, with characters in the hexadecimal range from 0x0000 to0xFFFF.

Because 16-bit encoding supports 216 (65,536) characters, which is insufficient to define all characters in use throughout the world,the Unicode standard was extended to 0x10FFFF, which supports over onemillion characters. The definition of a character in the Javaprogramming language could not be changed from 16 bits to 32 bitswithout causing millions of Java applications to no longer runproperly. To correct the definition, a scheme was developed to handlecharacters that could not be encoded in 16 bits.

The characters with values that are outside of the 16-bit range, and within the range from 0x10000 to 0x10FFFF, are calledsupplementary characters and are defined as a pair of char values.

查看unicode字符表here .

关于java - java中原始类型char的值指的是哪个Unicode表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22903406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com