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