Unable to create a file with foreign language characters

后端 未结 5 1442
旧巷少年郎
旧巷少年郎 2020-12-17 09:35

I get the following error, when trying to save a properties file (containing name/value pairs) with foreign language characters. How do I set the encoding?

相关标签:
5条回答
  • 2020-12-17 09:40

    Assuming it is in Eclipse, easiest way is to choose Save as UTF-8 option present in the error dialog box.

    The other answers work well too.

    0 讨论(0)
  • 2020-12-17 09:41

    Fist copy the file and delete that file and then cleat your code in the eclipse after

    create file with same content and rewrite the code it will resolve.

    0 讨论(0)
  • 2020-12-17 10:01

    Best possible solution for this , which I always do .Is to go the respective file in your workspace open it in notepad++ and make the desired changes. Once done , save the file. Your eclipse will ask you to update the code with the changes . Click yes. And you are all good to go now.

    0 讨论(0)
  • That looks like Eclipse.

    1. Cut the whole contents of the file into the clipboard.
    2. Save the (now empty) properties file.
    3. Change the encoding settings of the file (Alt+Enter) to be UTF-8 or whatever you need.
    4. Paste the clipboard into the editor.
    5. Save the editor.
    0 讨论(0)
  • 2020-12-17 10:06

    I presume its eclipse:

    1. Go to Windows Menu –> Preferences –> General (expand it) –> Workspace (click on it)
    2. Look for a box “Text File Encoding”. Default will be “Cp1252″.
    3. Change radio to select other and select “UTF-8″ from combo box.
    0 讨论(0)
提交回复
热议问题