Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set charset encoding property for SVN File and Eclipse

Tags:

eclipse

svn

utf-8

I have a file which has international characters (UTF-8). How so I set this encoding type as a part of svn property and how do I ensure that it overrides automatically default encoding in eclipse i.e. eclipse should automatically set UTF-8 encoding based on the svn property (may be mime-type).

like image 905
harrybvp Avatar asked Jul 28 '11 08:07

harrybvp


People also ask

How do I change the encoding of a properties file in eclipse?

properties files are Latin1 (ISO-8859-1) encoded by definition. ISO-8859-1 as its default encoding. You can change this under: Preferences > General > Content Types.

How do I change the default encoding in Eclipse?

In Eclipse, go to Preferences>General>Workspace and select UTF-8 as the Text File Encoding. This should set the encoding for all the resources in your workspace. Any components you create from now on using the default encoding should all match.

How do I change my UTF-8 character set?

Click Tools, then select Web options. Go to the Encoding tab. In the dropdown for Save this document as: choose Unicode (UTF-8). Click Ok.


3 Answers

svn propset svn:mime-type "text/plain; charset=UTF-8" filename...

like image 177
cabo Avatar answered Oct 02 '22 09:10

cabo


I had same problem, but solved by setting below:

Set Encoding in Eclipse: Project --> Properties --> Resources --> Text File Encoding --> Other (UTF-8)

like image 33
user8345631 Avatar answered Oct 02 '22 10:10

user8345631


I was struggling with this for a while, and have found another solution. If you're using maven you can set the encoding in the pom. see https://maven.apache.org/general.html.

After you've added this, when you do a Maven > Update Project (Alt + F5) it will set the correct encoding for the project.

<project>
  ...
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  ...
</project>
like image 24
Chris M Avatar answered Oct 02 '22 11:10

Chris M