Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File Encoding handling in Eclipse 3.5

I use Eclipse 3.5 on Windows, with PDT and Subclipse plugins, with both legacy projects using ISO-8859-1 encoding (latin-1), and newers ones wich use UTF-8. I configured my workspace to use UTF-8, and I configured old projects to use latin-1. But every time I open an old project, it use UTF-8. With a workspace using latin-1 by default, I have the same problem with utf-8 projects edited as iso-8859-1.

My encoding choice is written in the file .settings/org.eclipse.core.resources.prefs but seems to be never read.

The only solution for now is to have a latin1 workspace, and an utf8 one. Any better idea?

like image 697
Cédric Girard Avatar asked Sep 12 '26 22:09

Cédric Girard


1 Answers

In the project's properties (right-click on project => Properties => Resource) there is a Text File Encoding section.

Did you configure the encoding here? If not, you have two choices : "Inherited from container" (which should be the workspace default, in your case UTF-8) and "Other" which let you choose a specific encoding (ISO-88591)...

I just tested that on one of my projects, closed it and reopened it and the ISO88591 encoding is still configured.

Note that I'm using a plain Eclipse though, not a PDT project. PDT may handle encoding settings differently, but somehow I doubt that (file encoding being a low level functionality it makes sense that all plugins share this behavior).

like image 67
Simon Baslé Avatar answered Sep 16 '26 18:09

Simon Baslé



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!