Reputation: 1246
I wanted to know if its posible to set a different file encoding per each project I have on eclipse.
I know that I can have different workspaces and set a different encoding for each one, but id like to have all my projects on one, if posible...
Upvotes: 1
Views: 2465
Reputation: 1584
This is not working with Eclipse Mars, for some file types, as eg JavaScript. For *.js files, the configuration "Determined from content type" is having precedence over the project's Resource configuration.
I've also tried to specify my JS directory encoding in .settings/org.eclipse.core.resources.pref
, which is specific for the project, by defining
encoding//src/main/webapp/js=ISO-8859-1
, but then again the workspace configuration is having precedence.
I have a development environment with two distinct projects, one in UTF-8 (newer) and anoter in ISO-8859-1 (legacy). I would like to easily switch between them.
One solution I've found was to create two workspaces. It worked, but it seems rather awkward as instructions to other developers. So it would be desirable to really have such configurations on a per-project basis.
Upvotes: 0
Reputation: 111217
Yes you can.
Open the Properties for the Project and select the 'Resource' tab. Set the 'Text file encoding' to what you want.
Make sure that all the files in the project have their Text file encoding set to 'Default (inherited from container)'
You can also set the defaults for everything in a Folder in the same way.
Upvotes: 3
Reputation: 12378
I think it's possible.
2.Right click and select Properties.
3.Select Resource menu and you can choose your file encoding.
Upvotes: 1