Community
Participate
Working Groups
Build Identifier: Version: 3.6.1 Build id: M20100909-0800 I'm working with workspaces consisting of (Java) projects from different teams from different original VCS repositories, each of these teams have (historically) different default encodings for their workspaces. Now some parts of my workspace are CP1252, some are UTF-8, and not all of them specify their project encoding in the project (i.e. in .settings/org.eclipse.core.resources.prefs). This makes it very likely that developers get and/or produce corrupted text files. As is evident in the discussion on bug 108668, there is no single default character encoding which fits all purposes. It makes little sense to default encoding on the platform, as is currently the case, as soon as projects are shared between users. Strictly speaking, the contents of text files in a VCS checked in by a user only relying on workspace default encoding are undefined. To fix this, it should be mandatory to specify an encoding per project. This can still default to the workspace default, which itself defaults to the platform encoding if not set by the user, but a .settings/org.eclipse.core.resources.prefs file with the encoding/<project>=... line should always be written when creating a project. This way you can import an arbitrary set of projects into an arbitrary workspace and get the encoding right, always. (Of course this can be done manually but the platform should do its best to enforce consistency.) Reproducible: Always
(In reply to comment #0) > To fix this, it should be mandatory to specify an encoding per project. This > can still default to the workspace default, which itself defaults to the > platform encoding if not set by the user, but a > .settings/org.eclipse.core.resources.prefs file with the encoding/<project>=... > line should always be written when creating a project. I don't see a good reason to obligatorily specify the project encoding. If your team needs it, you can always write a simple plug-in for the team that sets the encoding on project creation and validates that all projects in your workspace have it set too.
. *** This bug has been marked as a duplicate of bug 479450 ***