So I am cloning some java files from git to eclipse. There are special characters like Ü è. letters you would see in the Spanish language that java normally does not like. When I open up the project in java it turns them into the square with the ? in the middle of it and java complains about it saying there is a special character problem. It wouldn't be that big of a problem but I'm doing it for work and there are A LOT of code and go through and a lot of special characters. Anything I can do about this to either make java like it or not change the characters when I go from git to eclipse?
Asked
Active
Viewed 1,155 times
1
-
1Would https://stackoverflow.com/a/9181068/6309 help? – VonC Jan 13 '18 at 20:55
-
I don't think so its because when I download from git it just auto changes it to the ? in the square – greatsoccerman1 Jan 13 '18 at 23:19
1 Answers
0
(Assuming that when you say "I open up the project in java" you actually mean opening the project in Eclipse:)
You need to do two things: first figure out what the file encoding is, second change your settings so Eclipse would use that encoding. Figuring out the encoding can be troublesome. With a git remote repository on Unix the obvious guess would be UTF-8, with Windows UTF-16 would also come into my mind as a possibility. In worst case you can always open your file in a hex editor and check how are your special characters actually encoded. After that making Eclipse use that encoding is easy. (And you may consider changing it only for this special project of yours.)

ytg
- 1,755
- 2
- 23
- 41