Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Editor does not remember which encoding was selected for file #35

Open
Cryvage opened this issue Jul 22, 2016 · 3 comments
Open

Editor does not remember which encoding was selected for file #35

Cryvage opened this issue Jul 22, 2016 · 3 comments

Comments

@Cryvage
Copy link

Cryvage commented Jul 22, 2016

  1. open file (encoding not recognized)
  2. select encoding, e.g. "windows 1251" (text displayed normally)
  3. you can do anything with the file: edit, save, or do nothing - it doesn't matter
  4. close tab with file
  5. open file again (encoding not recognized)

It makes almost impossible to work, if project contains files with different encodings

upd: edited title to be clearer

@Cryvage Cryvage changed the title Can't save selected encoding for file Editor does not remember which encoding was selected for file Jul 25, 2016
@50Wliu
Copy link
Contributor

50Wliu commented Mar 3, 2017

I believe you're asking for automatic detection of the encoding when you open the file. If so, this is being tracked under #24.

@50Wliu 50Wliu closed this as completed Mar 3, 2017
@Cryvage
Copy link
Author

Cryvage commented Mar 3, 2017

Not exactly. I was thinking about it for a long time. If we set "autodetection" as "default encoding", then which encoding, editor should use when saving or creating the file? Actually, the "default encoding" in project settings should only affect, which encoding will be used when creating or saving files. As for opening, it's natural, to open the file in the same encoding, which it originally has.
In this issue I was talking about manually selected encoding, not about autodetection. I've selected the encoding manually, and editor does not save this information somewhere. The next time running the editor I'll have to select encoding for this file again.
I think, that encoding autodetection, will not solve this issue completely. What if encoding autodetection would be "by default"? The opportunity of manual selection still remains? I think so. At least in cases, when autodetection fails. Anyway if someone has selected encoding manualy, then he has the reason for this. And in this case, editor should save this information somewhere in project metadata, to restore selected encoding later.
On the other hand, I agree that if encoding autodetection will work as it should, manual encoding selection maybe just will not be needed, except some rare case.

@50Wliu 50Wliu reopened this Mar 3, 2017
@juliux-arg
Copy link

One workaround may be a text in the beginning of file in a comment section to indicate a fixed manual encoding, like shebang in unix shell files: https://en.wikipedia.org/wiki/Shebang_(Unix). In jEdit there is something similar for a per-file configuration. It may be useful by itself.
Another feature could be a default encoding per syntax mode (language). It may be useful too.

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

No branches or pull requests

3 participants