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.
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.
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.
1 Answer. Show activity on this post. Under preferences General->Workspace, there's an "Save automatically before build" option.
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
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)
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:
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With