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).
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.
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.
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.
svn propset svn:mime-type "text/plain; charset=UTF-8" filename...
I had same problem, but solved by setting below:
Set Encoding in Eclipse: Project --> Properties --> Resources --> Text File Encoding --> Other (UTF-8)
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With