Text damaged after changing Eclipse encoding to UTF-8

I had to change the Indigo Eclipse encoding to UTF-8. Now all characters, like éàçè, are replaced.

I can do a search and replace, but I wonder if there is a better solution.

thank

+5
source share
3 answers

Changing the encoding in Eclipse does not change your existing files: it only changes the way you read Eclipse.

You need to convert the old files to UTF-8, as well as configure Eclipse.

There are several tools for this, and you can write a small java program.

, , : http://www.marblesoftware.com/Marble_Software/Charco.html ( () .

( 20 LOC), , :

​​:

  reader = new BufferedReader(new InputStreamReader(new FileInputStream(...), "you have to know it"));
  writer = new OutputStreamWriter(new FileOutputStream(...), "UTF-8"); 
  String line;
  while ((line=reader.readLine())!=null) {
     writer.write(line);
  }
+7

notepad ++ . , / . , " " ( , ...)

++

+2

alt + enter, UTF-8

0

All Articles