Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » problem with unicode symbols in UTF-8 files(UTF-8 encoded files containing unicode symbols are not detected as utf-8 and saving as utf-8 is breaking the symbols)
problem with unicode symbols in UTF-8 files [message #1856535] Wed, 14 December 2022 10:49 Go to next message
Ravenous Bugblatterbeast is currently offline Ravenous BugblatterbeastFriend
Messages: 25
Registered: April 2020
Junior Member
After switching to a new workstation, existing utf-8 files containing unicode symbols are not detected properly. Those unicode symbols are correctly displayed in other editors like kate or VSCode but not in eclipse. When I edit those files, eclipse complains that it can't save them because they're not utf-8 and suggests to save them as such. After doing so, the unicode symbols are broken in all editors.

Source code in kate:
    case PolygonRCC_ECS:
      //  ┌───┐
      //  │ A ┢━━━┓
      //  └───┨ B ┃
      //      ┗━━━┛


Same source code in eclipse (and in all editors after saving as utf-8):
    case PolygonRCC_ECS:
      //  ���������������
      //  ��� A ���������������
      //  ��������������� B ���
      //      ���������������


Any idea, what I might have configured wrong? I've created those files using eclipse on my old workstation.

Best regards
Re: problem with unicode symbols in UTF-8 files [message #1856540 is a reply to message #1856535] Wed, 14 December 2022 13:07 Go to previous messageGo to next message
Ravenous Bugblatterbeast is currently offline Ravenous BugblatterbeastFriend
Messages: 25
Registered: April 2020
Junior Member
Error messages says the reason is:
Some characters cannot be mapped using "ANSI_X3.4-1968" character encoding for file...
Either change the encoding or remove the characters which are not supported by the "ANSI_X3.4-1968" character encoding.


After the files are checked out from git repository, they look broken in eclipse.
It seems OK, after copying the broken parts from other editor and paste into eclipse and then save as utf-8.

I think eclipse doesn't recognise the checked out files are utf-8 and is trying to display them as ASCII and then writes the '�' characters (for each 8bits of the special chars) into the utf-8 file.

Can I make eclipse to assume by default that every file is utf-8?
Re: problem with unicode symbols in UTF-8 files [message #1856541 is a reply to message #1856540] Wed, 14 December 2022 13:14 Go to previous message
Ravenous Bugblatterbeast is currently offline Ravenous BugblatterbeastFriend
Messages: 25
Registered: April 2020
Junior Member
Went to Preferences>General>Workspace and selected UTF-8 as the default Text File Encoding.

I don't remember making this change on the old workstation... did the default value maybe change? Regardless, the problem is solved and all files display and save nicely now.

[Updated on: Wed, 14 December 2022 13:15]

Report message to a moderator

Previous Topic:refactoring fails in cmake generated projects
Next Topic:headlessbuild application problem
Goto Forum:
  


Current Time: Tue Jan 14 21:07:12 GMT 2025

Powered by FUDForum. Page generated in 0.03624 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top