Solved

Eclipse won't compile due to encoding issue

Posted on 2010-11-23
8
454 Views
Last Modified: 2012-05-10
Hi, I have a number of .java files which contain such characters as '。', stopping the eclipse compiler from compiling the files.

How can I solve this issue?

Thanks.
0
Comment
Question by:wsyy
8 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 25 total points
ID: 34201959
Preferences>General>Workspace and select the right encoding
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34201962
If you're not sure which, try utf-8
0
 
LVL 92

Assisted Solution

by:objects
objects earned 25 total points
ID: 34202002
right click on the file and select Properties
goto Text file encoding in Respource section, check "Other" and select the appropriate encoding (probably UTF8)
0
 
LVL 92

Expert Comment

by:objects
ID: 34202162
the other alternative is to use native2ascii to encode the strings
and by moving them into properties files makes it easier to manage
there a good plugin that handles the conversion for you
http://propedit.sourceforge.jp/index_en.html
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:techsathish
ID: 34204119
String str = "va'l";
URLEncoder.encode(str, "ISO-8859-1");

Use like above example to encode the character and use it..
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34204151
>>the other alternative is to use native2ascii to encode the strings

That's not for setting the encoding of source code. You need to set the encoding for the whole editor
0
 

Author Closing Comment

by:wsyy
ID: 34205595
Thank you all.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34207401
:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now