Community
Participate
Working Groups
Created attachment 284391 [details] This is a text file encoded in CP1252 with characters that are affected by this bug I opened a project made by someone using the Windows version of Eclipse. When opening it the characters '£' and '’' had been replaced by `�`. After looking into this it seems this is happpening due to Windows version of Eclipse encoding text based files ('.java','.txt') files in 'Cp1252'/'Windows1252' when in Linux it expects to get text files in 'UTF-8'. This is a compatibility issue that affects teams that have Linux and Windows users. Also even when setting the Workspace to use CP1252 it still opens text files in UTF-8. This makes me think this is a bug with the character encoding detection on Linux. Steps to reproduce: 1. Make new text based file in any text editor (or Windows Eclipse) with character encoding 'Cp1252' (sometimes called 'Windows1252') and any of these characters: €‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢¤¥¦§¨©ª«¬®¯ 2. Open the text file with Eclipse on Linux Method to fix file: - Edit>Set Encoding...>Other: Cp1252 or 1. Open with other text editor (e.g. gedit) 2. Save as and under Character Encoding set it to UTF-8 3. Open in eclipse
Different encoding settings on different platforms always result in difficulties. Best practice is to have a IDE setup in which you configure the encoding on all platforms (e.g. with Oomph) or, even better, configure the encoding on a Project level. Non-default file encodings will be stored in the .settings folder. Not sure if there is really a bug here. Can you double check the encoding settings of the project and folder you have imported the file in? Right-click the project/folder > Properties. Please provide details if (and where) in the (inheritance) of Encodings you see the issue.