Java solution: & quot; error: un dable characters encoded in GBK & quot;, javagbk

Source: Internet
Author: User

Java problem solving: "error: un dable characters encoded for GBK", javagbk

References: http://blog.csdn.net/l1028386804/article/details/46583279

Scenario:

The following error occurs when you use javac to compile a java file:

Solution:

Use the javac-encoding UTF-8 to compile the. java file:

Note:

ANSI: the standard text storage format preset by the American National Standards Association. Simplified Chinese code: GB2312, which is actually an ANSI code page 936

UTF-8: Universal word set conversion format, which is designed for Transmission Encoding, binary, 8-bit for Unicode encoding, if you are using an old-style transmission media that only supports 8 important data types in the same type of metadatabase group, you can select the UTF-8 format.

In the UTF-8, English characters are still the same as ASCII encoding, so the original function library can continue to use. The Chinese encoding range is between 0080-07FF, so it is represented by two bytes (but the two bytes are different from those encoded by GB ), UTF Encoding can be processed using specialized Unicode processing classes.

 

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.