How to convert existing files' encoding to UTF-8 in eclipse Luna

1.4k views Asked by At

I have many files of various types with different encodings. Ideally I want to change the encoding of all files of a specific type to another encoding (for example change the encoding of all PHP files to UTF-8).

I know I can change a specific file's encoding from its properties menu, but I was wondering if there is a way to apply the change to all files without iterating manually through each one of them.

1

There are 1 answers

1
Inazense On

If you need to change all files with one extension, you can go to Window > Preferences > General > Content types, press on Select text dropdown and select the language that you want to change the enconding.

After that, in File associations section choose all the extensions that you want to change and in the bottom of the page, on Default encoding input box, write the encoding that you want to use and press Update after that.

For example, to change PHP in the Content Types you need to select PHP Content Type, as you can see here:

enter image description here