About Java console input and output garbled problem

Source: Internet
Author: User

Cause: Because the default character encoding for this open source project is UTF-8, the character encoding of my console is automatically changed to UTF-8, and the default format for the input stream of the keyboard is GBK format. This causes the odd garbled error (the explanation of this problem can be found in the search engine) in the process of GBK turning UTF-8.

Workaround:
1. Console encoding, Common (right), run configurations-R, right-click Code area
If this error occurs, the encoding format should be UTF-8, select Other, at this point there may be no GBK option, if not, then perform the operation after.

2. Change the text file encoding for the item, resource, properties, right-click, first adjust the text file encoding back to GBK, and then go back to reset console encoding encoding to GBK.

About Java console input and output garbled problem

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.