Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdt-papyrus.dev] File Encodings (esp. for Xtend)

Hi, Team,

In trying to get the Gerrit patch for the new Papyrus diagram tests generation framework to work, I have found that all of the Xtend sources in the test bundles are encoded with the default Windows file encoding (Cp1252).  This is a problem for Xtend in particular because of its use of guillemet characters (« and ») that are not in the ASCII character set.

For those of us on non-Windows platforms, Cp1252 is not the default encoding, neither in Eclipse nor in any other tool.  Eclipse defaults to UTF-8 encoding for the workspace (I think, or maybe I set it thus because MacRoman would be so much worse!).  Consequently, the Xtend compiler breaks on trying to read these files because decoding Cp1252-encoded guillemets as UTF-8 produces characters that definitely are not guillemets.

Many of our Xtend projects now actually specify UTF-8 encoding for their contents in the resource preferences in the .settings/ folder.  This is extremely helpful to non-Windows contributors.

Can we make it a project policy that everybody contributing do whatever it takes to ensure that all source files that they contribute use the UTF-8 encoding on every platform, except where it is necessary for some (extremely rare) reason to use a different encoding?  And our code review process should enforce the UTF-8 encoding for Xtend sources so that we aren’t always having to fix it up afterwards.

In the mean-time, I am running all of the sources in this particular Gerrit patch through iconv.

Thanks,

Christian




Back to the top