17

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).

Wolf
  • 9,246
  • 7
  • 59
  • 101
harrybvp
  • 2,403
  • 2
  • 21
  • 29
  • Maybe related: [How to support UTF-8 encoding in Eclipse](https://stackoverflow.com/q/9180981/2932052) – Wolf Jan 05 '21 at 12:20

4 Answers4

19

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

cabo
  • 937
  • 8
  • 9
2

I had same problem, but solved by setting below:

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

1

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>
Keshan Nageswaran
  • 7,847
  • 3
  • 26
  • 42
Chris M
  • 1,008
  • 1
  • 13
  • 24
0

In SVN, I don't know but you can set text file encoding on each file individually: right-click on the file, go to properties and in the resource submenu check 'Other' for Text File Encoding.

CRABOLO
  • 8,495
  • 38
  • 39
  • 67
Nicolas
  • 1,066
  • 6
  • 17
  • My requirement is eclipse should auto pickup contenttype/char encoding of the SVN File,I dont want to set it manually. – harrybvp Aug 09 '11 at 16:15