Eclipse's. Properties file Chinese display problem

Source: Internet
Author: User

Eclipse Open the properties file containing Chinese characters, display garbled;

Before saving to:

User.name=, right?

After saving:

user.name=\u5bf9\u5440

Properties file encoding for iso8859-1, in fact, this is not garbled, just convert Chinese characters to ASCII characters


When we look closely, we find that the characters are in the form of \uxxxx. If you are familiar with Unicode encoding, we should know that the \uxxxx form is a Unicode code point, where eclipse automatically converts Chinese characters to ASCII characters.

So, strictly speaking, this is not garbled.

Of course this is not the point, the emphasis is on our understanding of the principle of coding;


This is because the properties of the encoding method is incorrect, the properties file by default encoding is iso8859-1, after modifying it to utf-8, it can be displayed correctly.

Right-click the properties file----> Properties------->resource----->text File Encoding------> select other Utf-8





See here we may think, how to change the default encoding of the properties file to Utf-8?

Window---->preferences---->general----->content Types----->text------>java Properties File----> UTF-8---->update------>ok

Note here that you must click Update, otherwise it will not work.



Eclipse's. Properties file Chinese display problem

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.