如何在Eclipse中更改*默认*默认编码? [英] How to change the *default* default encoding in Eclipse?

查看:636
本文介绍了如何在Eclipse中更改*默认*默认编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次创建一个新工作区时,Eclipse默认使用Cp1250编码。



每当我创建一个新的项目分支,在Eclipse中,我需要转到



我可以永久地更改默认值,以便所有新工作区以UTF-8开始,而不需要手动切换?

解决方案

这是一个关键的事情,


  1. 打开刻录机,更改您想要的首选项,在这种情况下是您的编码,然后按OK。然后系统将询问您是否要跟踪所有工作区中更改的首选项。您可以更改用户政策列中的值。


  1. 现在,如果您创建一个新工作区,那些跟踪的首选项将应用于新工作区。


  2. 如果您想查看正在录制的内容,请在偏好设置中查看Oomph - >设置任务 - >首选录音机



  1. 要访问完全设置配置,按下记录到下拉列表(UI右上角)右侧的按钮,安装文件将在编辑器中打开,您可以进一步控制和修改:



PS。默认的默认编码是一个热烈争论的问题在Eclipse,希望默认默认将改为UTF-8无处不在。


Every time a new workspace is created, Eclipse defaults to Cp1250 encoding.

Whenever I create a new branch of the project, and as result switch to a new workspace in Eclipse, I need to go to Window -> Preferences -> General -> Workspace : Text file encoding and manually switch to "Other: UTF-8". If I forget this step, Eclipse mangles the UTF-8 characters in the project files.

Can I change the default somehow, permanently, so that all new workspaces start as UTF-8 without need to switch them manually?

解决方案

This is one of the key things that Eclipse Oomph was created to solve, the ability to set default default preferences, i.e. preferences set across workspaces.

You can go "whole hog" and adopt using Oomph as a full Eclipse Installer and share the install scripts between your team members. The installer can configure everything from which plug-ins to install, to default preference values, to where to check code out from.

Preference Recorder

However, for now you can simply use the Preference Recorder.

  1. Install Oomph, it is possibly already installed if you are using Eclipse Mars. If not, from the Mars update site you can install "Oomph Preference Management"
  2. Open the preferences page, you should now have a new icon next to Help in the bottom left. It will allow you to turn on/off the preference recorder:

  1. With the recorder on, change your preferences you want, in this case your encoding, then press OK. You will then be asked if you want to track the changed preferences across your workspaces. You can change the values in the User Policy column.

  1. Now if you create a new workspace, those tracked preferences will be applied to the new workspace.

  2. If you want to see what is being recorded, in Preferences, see Oomph -> Setup Tasks -> Preference Recorder

  1. To access the full setup configuration, press the button to the right of the Record Into drop-down (top right of UI) and the setup file will be opened in the editor, where you can do further control and mods:

PS. the default default of the encoding is a hotly contested issue at Eclipse, hopefully the default default will change to UTF-8 everywhere.

这篇关于如何在Eclipse中更改*默认*默认编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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