I have a project (in java) with more than 100 files, some of them are in other ISO in UTF8.
How to change the encoding of all ISO files to UTF-8 without losing the special characters?
I have a project (in java) with more than 100 files, some of them are in other ISO in UTF8.
How to change the encoding of all ISO files to UTF-8 without losing the special characters?
If you are using Eclipse :
If you are on NetBeans :
As you said that your project has more than 100 files in encoding other than UTF-8, and you will change them, it is very likely that a lot of special characters will break (even if you do not want to). For example: "á" can become " ". What's more, if you compile your software, you might get unmappable character .
Take a test in NetBeans, I did some testing here and did not break special characters, unlike Eclipse.
It's good to set up your editor to use the correct encoding later, but initially it's much better to convert the files automatically.
If you're on any Unix, just use the recode:
$ recode utf8 *.java
To process recursively:
$ find . -name "*.java" -exec recode utf8 {} \;
The recode is very flexible, you can do a lot more things. Credits for this response .