Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handling file Encoding #49

Open
dail8859 opened this issue Dec 4, 2021 · 3 comments
Open

Properly handling file Encoding #49

dail8859 opened this issue Dec 4, 2021 · 3 comments

Comments

@dail8859
Copy link
Owner

dail8859 commented Dec 4, 2021

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

@buer37
Copy link

buer37 commented Nov 15, 2022

When will this function be available?

@dail8859
Copy link
Owner Author

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.

@bestbai
Copy link

bestbai commented Feb 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants