Properly handling file Encoding
There is no file encoding support currently.
I don't understand file encodings enough to know I'm doing it correctly. The uchardet library is linked in which can detect file encodings.
CC: @hongnod
When will this function be available?
The short answer is: I don't know.
There are several unknown pieces involving the uchardet library, Qt's text conversion, Scintilla, code pages, etc. So it is definitely no small task and will take some time for me to get the desire to start digging into it.
Regardless of the encoding of the file, it will always be saved in utf-8, because the content is converted to utf-8 when it is imported into the editor. Based on the above process, you can specify a non-utf-8 codec when reading a file, and still use utf-8 when importing content into editor, and convert the utf-8 content to the specified codec before saving the file. A similar situation exists for BOM.
If there are not too many encodings to deal with, you can use this method for emergency.
A demo with Simplified Chinese encoding https://mega.nz/folder/NSh1UZBR#cdZZDgQ0kJY-BtAnuM1vyA