Bug 567724 - Symbols replaced with � (Replacement Character) when opening projects from Windows Eclipse
Summary: Symbols replaced with � (Replacement Character) when opening projects from Wi...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.17   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-08 13:32 EDT by Harry Syred CLA
Modified: 2020-11-01 09:29 EST (History)
1 user (show)

See Also:


Attachments
This is a text file encoded in CP1252 with characters that are affected by this bug (44 bytes, text/plain)
2020-10-08 13:32 EDT, Harry Syred CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Syred CLA 2020-10-08 13:32:18 EDT
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
Comment 1 Rolf Theunissen CLA 2020-11-01 09:29:34 EST
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.