Printing Chinese characters with programs

Source: Internet
Author: User
Tags comparison table

1 //Short start = (short) 0xb0a0;2          ShortStart = ( Short) 0xa1a0;3         //GBK gb2312 Big5 gb180304String encoder = "gb2312";5 6Bytearrayoutputstream Bytearrayos =NewBytearrayoutputstream ();7DataOutputStream Dataos =NewDataOutputStream (bytearrayos);8 9              for( ShortK = 0x00; K < 0x5700; K + = 0x100){Ten                  for( Shortj = 0x00; J < 0x60; J + = 0x10){ One                      for( Shorti = 0x00; i < 0x10; i + = 0x01){ ADataos.writeshort (start + i + j +k); -                         //Write a space -Dataos.write ("". GetBytes (encoder)); the                     } -Dataos.write ("\n\r". GetBytes (encoder)); -                 } -Dataos.write ("\n\r". GetBytes (encoder)); +             } -  +System.out.println (bytearrayos.tostring (encoder));

Unicode, UTF-8, GBK Mutual transfer

Unicode is not linearly related to GBK encoding, and Unicode is encoded in the order of the glyphs (strokes: Portrait-by-point), while gbk,gb2312,gb18030 is encoded in the order of pinyin

So the conversion of Unicode and GBK encoding can only be converted by the comparison table:

Printing Chinese characters with programs

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.