每次重新启动后,Eclipse会重设文本编码设置 [英] Eclipse resets text encoding settings after every restart

查看:644
本文介绍了每次重新启动后,Eclipse会重设文本编码设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于具有在Cp1252中编码的旧旧代码的项目,我需要eclipse来使用这种编码而不是UTF-8(我通常用于所有项目)。如果我在Eclipse中使用UTF-8作为编码编译该项目,我在运行时会遇到问题,UI中的特殊字符不能正确显示。所有源代码文件的重新编码在这个时候不是一个可以接受的修复,不符合我的要求。



所以我去了窗口 - >设置 - > Workspace并将文本编码设置更改为默认值:Cp1252。当我编译之后,一切工作都完美无缺。到现在为止还挺好。



但是,每次重新启动Eclipse之后,Eclipse会将设置更改为其他:UTF-8。我已经尝试了很多东西来弄清楚Eclipse为什么这样做,而且我将会变空。



这甚至会在全新的Eclipse安装即将文件解压缩到硬盘上的空文件夹)和新创建的空工作区。我从字面上开始Eclipse的全新安装,创建了一个新的工作区,文本编码的设置为其他:UTF-8。我将其更改为默认值:Cp1252,关闭Eclipse,再次启动,并再次设置为其他:UTF-8。我还尝试将其设置为其他:Cp1252,但这并不会改变任何内容 - 它仍会重置为其他:UTF-8。



我想这里必须从某个地方读取一些系统范围的设置,但我不知道甚至要找什么。



另外,只需将项目的编码更改为Cp1252没有帮助,因为我仍然会遇到特殊字符的问题 - 显然我需要更改工作区范围的设置才能正常工作。



我是完全迷失在这一个。任何人都可以帮助我吗?

解决方案

对于有类似问题的人来说,这是由oomph引起的。
我通过在Ooomp - >安装任务首选项页面中启用选项启动时跳过自动执行任务来修复它。
我还未选中首选项记录器页面中的/instance/org.eclipse.core.resources/encoding条目,但我相信这不是必需的,因为我没有启用。


For a project that has old legacy code that is encoded in Cp1252, i need eclipse to use this encoding instead of UTF-8 (which i normally use for all projects). If I compile that project while using UTF-8 as encoding in Eclipse, i get problems at runtime with special characters in the UI not being displayed correctly. Re-Encoding all source code files is not an acceptable fix at this moment and is not up to me to begin with.

So i went to Window -> Settings -> Workspace and changed the Text-Encoding setting to "Default: Cp1252". When i compiled after that, everything worked flawlessly. So far, so good.

However, after every restart of Eclipse, Eclipse changes the setting back to "Other: UTF-8". I've tried quite a lot of things to figure out why Eclipse does this and I'm coming up empty.

This even occurs with a completely fresh installation of Eclipse (i.e. just unzipped the file into an empty folder on my harddrive) and a newly created empty workspace. I literally started the fresh installation of Eclipse, created a new workspace and the setting for Text Encoding was "Other: UTF-8". I changed it to "Default: Cp1252", closed Eclipse, started it again and it was again set to "Other: UTF-8". I also tried setting it to "Other: Cp1252", but that doesn't change anything - it still resets to "Other: UTF-8".

I guess there has to be some system-wide setting being read from somewhere, but i don't know what to even look for.

Also, simply changing the encoding for the project to Cp1252 doesn't help, as i still get the issues with special characters - apparently i need to change the workspace-wide setting for it to work correctly.

I'm completely lost on this one. Can anyone help me?

解决方案

For anyone having a similar issue, this is caused by oomph. I fixed it in my environment by enabling the option "Skip automatic task execution at startup time" in the Ooomp -> Setup Tasks Preference Page. I also unchecked the /instance/org.eclipse.core.resources/encoding entry in the "Preference Recorder" Page, but i believe that this is not necessary since i did not have this enabled.

这篇关于每次重新启动后,Eclipse会重设文本编码设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆