简体   繁体   中英

eclipse Charset for working with Windows & Linux on same Project

If you take a Project, where other Developers before work with the defaultsetting on Windows Eclipse installations (cp1250)... what can you do to come clear with your linux-installation of eclipse?

Or even, if you still work on Linux, and the other Developers work on windows, and don't wan't to change there settings?

I recommend to set eclipse Charsetting by default on UTF-8 instead of cp1250.

Here the Solution:

  1. Create a separately Workspace for all your cp1250-encoded Projects
  2. Go to Window > Pereferences > General > Workspace Type cp1250 into the dropdownbox ( if not in the list, your have to type it!! )
  3. Maybe, if it's a Problem, choose "line delemiter" Windows (For me the default-setting always work, so i doesn't need to change it anyway!)

Here a Screenshot off it: Config看起来像这样

Save it, and your done.

In my opinion there might be great "hassle" when changing the default text-file encoding from Cp1252 on windows to utf-8 globally, because it changes the system property file.encoding also when executing a program from eclipse. I had the case recently where a eclipse based product did not work the same way when I exported it because of a non-default file encoding.

But if you are keen, you may change the eclipse.ini file and add the -vmargs -Dfile.encoding=utf-8 to run your eclipse instance with another encoding.

Beware that there are some open bugs regarding that vm parameter for example on Solaris it is ignored.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM