Java Fundamentals---encoding and decoding

Source: Internet
Author: User

The so-called code is Char->byte

The so-called decoding is Byte->char

Iso-8859-1 Chinese characters will be absorbed by black hole all into "?"

GB2312 Kanji can be encoded as double-byte but the standard only supports 6,763 kanji and char to byte needs to look up a table

GBK and GB2312 are basically the same but contain more Chinese characters.

UTF-16 Char is forcibly split into two bytes non-existent parts write 00 rules simple coding efficiency high disadvantage waste some storage space and a Chinese character split into three bytes

One of the character codes that is damaged after the damage is appropriate for use between local disk and memory unsuitable for network transmission (easily corrupted bytes stream data is in bytes when transmitted over the network )

UTF-8 for characters within a single-byte range are still represented by 1 bytes, while 3 bytes for Chinese characters are more suitable for network transmission and UTF-8 in coding efficiency and

The security of the code, is the ideal Chinese encoding method

UTF-16 UTF-8 are all processing Unicode encoding

When compressing a character using a compression algorithm, you can't just see the number of characters decrease (which is meaningless), but focus on the final number of bytes, depending on the encoding you choose.

Java Fundamentals---encoding and decoding

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.