Java contains several bytes of numbers, letters, and Chinese characters.

Source: Internet
Author: User

2-byte Chinese Characters

1 byte

2-byte Chinese Punctuation

Punctuation 1 byte

 

Chinese characters are complex. 1 byte = 8 characters. 8 bytes from 0000 0000 to 1111 1111 can only represent 256 characters. 2 bytes are 2*8 = 16 characters, from 0000 0000 0000 0000 to 1111 1111 1111 1111 can be 65535 characters. More than 60 thousand words are enough to indicate the words we often use. Therefore, we use 2 bytes to represent Chinese characters. If there are many uncommon words in 3 bytes and occupy a lot of unnecessary storage space, we use 2 bytes instead of 1 or 3 international codes that represent Chinese characters.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.