Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save Could not be completed. ECLIPSE ERROR

Save could not be completed. Reason: Some characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "Cp1252" character encoding.

This is my problem while trying to change some of the codes of my project.and when I Remove the character or save as utf-8 the project will not run. Please Help me. Thank you so much in advance.

like image 680
Frustrated Developer Avatar asked Feb 23 '12 23:02

Frustrated Developer


People also ask

What is Cp1252 character encoding in Eclipse?

The default character encoding scheme in Eclipse is cp1252. You may be required to change this scheme, for example, if you intend to submit orders that contain character sets from languages such as Chinese, Japanese, or Norwegian. In this case, you can define the character encoding scheme as UTF-8.

How do I save a file in eclipse?

As you type in your program, occasionally select File->Save from the menu to save your work. You may enjoy the "content assist" feature of Eclipse. If you type a partial input and then hit CTRL+SPACE, a dialog shows all possible completions. Just pick the one you want from the list.

How do I save all files in eclipse?

1 Answer. Show activity on this post. Under preferences General->Workspace, there's an "Save automatically before build" option.


8 Answers

Remove all character/word in your class that are in language except English like japaneze or chaineaze etc.

otherwise

just copy your class from Eclipse and paste it to your System at any Location (C/desktop) and open it with your Editor (Notepad/Wordpad) and Edit it and save it and again copy it to your Eclipse> your project> your package

Thanks

like image 175
Jeetu Avatar answered Oct 19 '22 16:10

Jeetu


This might also happen when you try to do copy paste of code from other places such as PDF. The reason for this is because the eclipse doesn't all the time understand the characters that are from a PDF file.

The answer for this is to rewrite the code, or maybe copy pasting this through notepad (I personally never tried to copy through notepad)

like image 38
Tomer Avatar answered Oct 19 '22 17:10

Tomer


I received a similar message when trying to edit a file in Eclipse. When I saved as UTF-8 I lost some of the characters in my document. I was able to get around this by:

  1. Opening the file
  2. Go to Edit > Set encoding...
  3. Select Other
  4. Select ISO-8859-1
like image 45
kansasian Avatar answered Oct 19 '22 17:10

kansasian


I had the same problem.

I put the file into Notepad and saved it. Notepad will tell you that some of the characters will be lost. The ones you are loosing are those hidden or hard to identify characters. Then you take that very text file you just stored and paste it into eclipse or whatever you are using.

like image 24
Axel Schultze Avatar answered Oct 19 '22 15:10

Axel Schultze


When I have this issue, I save as utf-8 and there is no problem anymore.
If you save like this and it still doesn't work, there must be an error with the code. Sometimes, in XML, you have letters like this: đšćčš and that can be a problem.

like image 43
Slovenia Avatar answered Oct 19 '22 15:10

Slovenia


You can solve this in 2 simple steps:

1) change the encoding settings of the file (Alt+Enter) to be UTF-8 or whatever you need.

2) Save the file in the editor.

like image 45
Seif Tml Avatar answered Oct 19 '22 17:10

Seif Tml


When my version of eclipse (ADT 22) showed this message, the pop up error window presented the choice

"Find First Character."

Using this option will show you the offending characters in the file. In my case they were in a //COMMENT! so I just delete them. Save then worked.

like image 29
kandinski Avatar answered Oct 19 '22 17:10

kandinski


I faced the same problem in eclipse. Then I found out that the file permissions somehow got changed. The problem was resolved once the write permission was added

like image 30
midhun mathew Avatar answered Oct 19 '22 16:10

midhun mathew