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

Closed
cwqbupt opened this Issue Sep 3, 2016 · 3 comments

Projects

None yet

2 participants

@cwqbupt
cwqbupt commented Sep 3, 2016 edited

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.
@eranif
Owner
eranif commented Sep 3, 2016

Like mentioned on the forum, please add the file as an attachment.

@cwqbupt
cwqbupt commented Sep 4, 2016

Here is the sample file, thanks:
purge.txt

@eranif eranif closed this in 9b0b6ee Sep 7, 2016
@cwqbupt
cwqbupt commented Sep 9, 2016

Thanks fixing it so quick.
Reviewing of this issue, it is because of codelite could recognize only 1 encoding at a time, comparing to other editors such as vim, sublime text etc, they supports multiple encodings and will recognize the file encoding intelligently, that should be a great feature if it is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment