1

I set my eclipse default encoding by trying: Windows > Preferences > General > Content Types, set UTF-8 as the default encoding for all content types. Windows > Preferences > General > Workspaces, set "Text file encoding" to "Other : UTF-8".

Then we I import some projects, it always mess up some characters:

 case 'a': case 'e': case 'i': case 'o': case 'u': case 'y': case '�': case '�': case '�': case '�': case '�': case '�': case '�': case '�': case '�': case '�': case '�': case '�': } 

What should I do? Any ideas?

1
  • Does the Text font you have selected in Eclipse support these characters? Commented Sep 21, 2013 at 21:11

2 Answers 2

1

Two things maybe happening:

  1. Some projects (even folders and/or files) may have their own specific charset which could be different to the whole workspace-level charset preference. You could right-click on the specific file and do Properties -> Resource to check which text file encoding is really being used (Default computed or Other). As additional info, this Resource specific preferences are stored in the ./settings/org.eclipse.core.resources.prefs file of the project.

  2. If the computed charset is UTF-8, the file you are viewing in the Java editor is not really coded in UTF-8. To verify that, you could check those characters in a hexadecimal editor, and use this useful UTF-8 table to compare the expected UTF=8 hex value in the table and the actual value the hex editor shows you it has.

Sign up to request clarification or add additional context in comments.

1 Comment

I messed up the encoding settings, and I installed the eclipse again. It is fine now.
0

Did you try to change the .java file encoding from Eclipse (right click on the .java file -> Properties -> Resource -> Text file encoding)?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.