Skip to content

codelite may auto remove the file content for an unrecognized file encoding on MAC OSX #1399

@cwqbupt

Description

@cwqbupt

when editing a file with unrecognized encoding and save, the file content will be removed automatically, so file content is lost.
step to reproduce:

  1. On Mac OSX 10, open codelite and set file encoding to windows 936: Codelite -> Preperences -> Misc -> Encoding Locale, file font encoding set to "windows-936", locale to use set to "zh_CN: Chinese (Simplified)".
  2. prepare a file with UTF8 encoding, file content:
    "获取中央redis上的较早的checkpoint集合,潜在的可删除集合".
    Here is the hex file content:
    0000000 8ee8 e5b7 968f b8e4 e5ad aea4 6572 6964
    0000010 e473 8ab8 9ae7 e884 83be 97e6 e7a9 849a
    0000020 6863 6365 706b 696f 746e 9be9 e586 8890
    0000030 bcef e68c 9cbd 9ce5 e7a8 849a 8fe5 e5af
    0000040 a088 99e9 e9a4 869b 90e5 0088
  3. import to codelite project by right click a directory in an existing project -> add existing file...
  4. open the file, check that the Chinese characters are shown in messy codes, add some text such as "abc", then save.
  5. then codelite prompts a dialog "File text conversion failed! Check your file font encoding...", click OK.
  6. go to the real directory where the file locates, see the the file size turns to 0 byte, and file content has been removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions