在eclipse的.properties文件中輸入的中文
0=正常
-1=未知異常
保存后了變成了這樣:
0=\u6b63\u5e38
-1=\u672a\u77e5\u5f02\u5e38
這是因為eclipse的.properties文件默認(rèn)編碼為iso-8859-1。
解決方案1,修改編碼為UTF-8(建議)
打開 Preferences->General->Content Typle->Text->Java Properties File,將Default Encoding 從 iso-8859-1 改為 UTF-8,點 Update 按鈕,然后再點 Apply and Close。
注意:一定要點擊Update按鈕,否則修改不生效!
解決方案2,安裝Properties Editor插件
Help -> Install New Software -> 輸入:http://propedit.sourceforge.jp/eclipse/updates
選擇 PropertiesEditor 進行安裝。