简体   繁体   English

保存 无法完成。 日食错误

[英]Save Could not be completed. ECLIPSE ERROR

Save could not be completed.无法完成保存。 Reason: Some characters cannot be mapped using "Cp1252" character encoding.原因:某些字符无法使用“Cp1252”字符编码进行映射。 Either change the encoding or remove the characters which are not supported by the "Cp1252" character encoding.更改编码或删除“Cp1252”字符编码不支持的字符。

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.这是我在尝试更改项目的某些代码时遇到的问题。当我删除字符或另存为 utf-8 时,项目将无法运行。 Please Help me.请帮我。 Thank you so much in advance.非常感谢你提前。

Remove all character/word in your class that are in language except English like japaneze or chaineaze etc.删除您班级中除英语以外的所有语言的字符/单词,如 japaneze 或 chaineaze 等。

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只需从 Eclipse 复制您的类并将其粘贴到您的系统中的任何位置(C/桌面),然后使用您的编辑器(记事本/写字板)打开它并编辑并保存它,然后再次将其复制到您的 Eclipse>您的项目>您的包

Thanks谢谢

This might also happen when you try to do copy paste of code from other places such as PDF.当您尝试从其他地方(如 PDF)复制粘贴代码时,也可能发生这种情况。 The reason for this is because the eclipse doesn't all the time understand the characters that are from a PDF file.这样做的原因是因为 eclipse 并不总是理解 PDF 文件中的字符。

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.我在 Eclipse 中尝试编辑文件时收到了类似的消息。 When I saved as UTF-8 I lost some of the characters in my document.当我保存为 UTF-8 时,我丢失了文档中的一些字符。 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选择 ISO-8859-1

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.然后,您将刚刚存储的文本文件粘贴到 eclipse 或您正在使用的任何文件中。

When my version of eclipse (ADT 22) showed this message, the pop up error window presented the choice当我的 eclipse (ADT 22) 版本显示此消息时,弹出的错误窗口显示了选择

"Find First Character."

Using this option will show you the offending characters in the file.使用此选项将向您显示文件中的违规字符。 In my case they were in a //COMMENT!就我而言,他们在//COMMENT! so I just delete them.所以我只是删除它们。 Save then worked.保存然后工作。

You can solve this in 2 simple steps:您可以通过 2 个简单步骤解决此问题:

1) change the encoding settings of the file (Alt+Enter) to be UTF-8 or whatever you need. 1) 将文件的编码设置(Alt+Enter)更改为UTF-8或任何您需要的。

2) Save the file in the editor. 2) 在编辑器中保存文件。

I faced the same problem in eclipse.我在 eclipse 中遇到了同样的问题。 Then I found out that the file permissions somehow got changed.然后我发现文件权限以某种方式改变了。 The problem was resolved once the write permission was added添加写权限后问题解决

When I have this issue, I save as utf-8 and there is no problem anymore.当我遇到这个问题时,我保存为utf-8就没有问题了。
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.有时,在 XML 中,您有这样的字母: đšćčš ,这可能是一个问题。

Copy your codes > open notepad > save file > copy your codes from notepad > paste eclipse.复制你的代码>打开记事本>保存文件>从记事本复制你的代码>粘贴eclipse。

And save it.并保存它。

Eclipse has been known (from my personal experience) to change the encoding of a file (perhaps I accidentally pressed a shortcut key).. but it is not obvious from the settings that the file encoding has changed. Eclipse 已经知道(根据我的个人经验)更改文件的编码(也许我不小心按下了快捷键)..但从设置中看文件​​编码已更改并不明显。 The eclipse file settings seemed to imply they were all inherited and all US-ASCII. eclipse 文件设置似乎暗示它们都是继承的并且都是 US-ASCII。 Then I went to use vi and tried the :set command (on a MacOS system), and found that the rest of my files were in UTF-8, but this one that was getting this problem, was in Latin1.然后我去使用 vi 并尝试了 :set 命令(在 MacOS 系统上),发现我的其余文件是 UTF-8,但遇到这个问题的文件是 Latin1。 "Save as UTF-8" solved the problem. “另存为UTF-8”解决了这个问题。 Still don't know how it switched to Latin1.仍然不知道它是如何切换到Latin1的。

Use this regular expression - [^\\x00-\\x7F] to find all non-standard characters and replace them with nothing.使用此正则表达式 - [^\\x00-\\x7F] 查找所有非标准字符并将其替换为空。 That worked for me.那对我有用。

This happened to me, when i had copied a source-code containing asian characters.这发生在我身上,当我复制了一个包含亚洲字符的源代码时。

.append("월 ] ")

just use "saved UTF-8"只需使用“保存的 UTF-8”

File img=new File("C:\\Users\\Ramakrishna\\Desktop\\Atal.jpg");

or要么

File img=new File("C:/Users/Ramakrishna/Desktop/Atal.jpg");

This line gave me problem.这条线给了我问题。 But the above solutions could not help me.I created a new package and recreated the class and wrote same line of code later it worked.但是上述解决方案对我没有帮助。我创建了一个新包并重新创建了该类,然后编写了相同的代码行,它起作用了。

I faced the same issue, Then just copied all texts from the file and closed the file.我遇到了同样的问题,然后只是从文件中复制了所有文本并关闭了文件。 Reopened it and pasted, this time eclipse allowed saving the file.重新打开并粘贴,这次 eclipse 允许保存文件。

If you are using maven and you just added some reporting plugins (in my case was: com.fasterxml.jackson.core ).如果您使用的是 maven 并且您刚刚添加了一些报告插件(在我的情况下是: com.fasterxml.jackson.core )。 You can fix it by adding this to your pom.xml :您可以通过将其添加到您的pom.xml来修复它:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

Here's the detail: How to configure encoding in Maven?这是详细信息: 如何在 Maven 中配置编码?

In Eclipse -在 Eclipse 中 -

  1. Change the encoding settings of the file by --> Alt+Enter select - UTF-8 or whatever you need.通过 --> Alt+Enter select - UTF-8 或您需要的任何内容更改文件的编码设置。

  2. Save the file.保存文件。

  3. Error is gone :)错误消失了:)

I was able to correct this problem in Eclipse by clicking File -> Properties.通过单击文件 -> 属性,我能够在 Eclipse 中更正此问题。 Then in Resource -> "Text file encoding" set to Other -> UTF-8.然后在资源->“文本文件编码”中设置为其他-> UTF-8。 Though my problem was a little different.虽然我的问题有点不同。 I wasn't able to save this character in ISO-8859-1.我无法在 ISO-8859-1 中保存这个 字符。

Open the Source Code from the workspace(C:\\Documents and Settings\\Administrator\\workspace\\myfiori_1) in the notepad or wordpad and save it there.从记事本或写字板中的工作区(C:\\Documents and Settings\\Administrator\\workspace\\myfiori_1)打开源代码并将其保存在那里。 It will be reflected here on eclipse.它将在 eclipse 上反映在这里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MobileServiceInvalidOperationException:请求无法完成。 (错误请求)保存图片 - MobileServiceInvalidOperationException: The request could not be completed. (Bad Request) on save images 检测到getView()调用已完成。 - Detecting getView() call completed. 设备启动完成后无法启动服务。 引导完成的BroadcastReceiver onReceive()未调用 - Unable to start Service after Device Boot Completed. Boot Completed BroadcastReceiver onReceive() not Calling 错误无法找到或加载主类-eclipse? - error could not find or load main class -eclipse? Eclipse无法解决字符串资源错误 - Eclipse could not resolve string resource error 在eclipse中如何保存logcat错误信息 - In eclipse how to save logcat error message 无法建立与数据库服务器的连接-Eclipse MySQL错误 - Could not create connection to database server - Eclipse MySQL error eclipse中无法启动android.support.v7.widget.Recyclerview错误 - android.support.v7.widget.Recyclerview could not be initiated error in eclipse Eclipse错误“找不到android-beacon-library.apk” - Eclipse error “Could not found android-beacon-library.apk” 操作无法完成。 找不到 Java 运行时。 有关安装 Java 的信息,请访问 http://www.java.com - The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM