Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Characters are changed when re open file #22

Closed
dabroder opened this issue Jul 13, 2016 · 6 comments
Closed

Characters are changed when re open file #22

dabroder opened this issue Jul 13, 2016 · 6 comments
Assignees
Milestone

Comments

@dabroder
Copy link

I write and save:
Diseño de aplicación.

When open I see:
Dise帽o de aplicaci贸n.

@dabroder
Copy link
Author

Probably is 'jschardet' library bug

@afiller
Copy link

afiller commented Jul 15, 2016

Wouldn't it in general be easier to assume the file is UTF-8 (backwards compatible with ASCII) and use the UTF-8 encoding directly in the fs command?

fs.readFile(p, 'utf8', function (err, data) {...

UTF-8 support all "relevant" characters and also writing should be no problem then.

@yhatt yhatt added the bug label Jul 16, 2016
@yhatt yhatt added this to the v0.0.9 milestone Jul 19, 2016
@dabroder
Copy link
Author

Hello @yhatt, most editors encode .md in utf-8 by default, and offers options for reopen with encoding.

@yhatt
Copy link
Owner

yhatt commented Jul 21, 2016

@dabroder Thank your notification. I understood what is happening. (When opening file, your example is detected as Chinese: GB2312)

We would rather not like to do away with multi-encoding support for few strange cases. In that case, the reopening option sounds good.

My idea is to add File -> Reopen With Encoding submenu. VS Code & Sublime have similar approach. Would you have any idea?

@dabroder
Copy link
Author

I like File -> Reopen With Encoding submenu.
Here is the list used by Atom

@yhatt
Copy link
Owner

yhatt commented Jul 30, 2016

@dabroder Work done. I have implemented File -> Reopen With Encoding menu in #53.

It would apply to the next release version (v0.0.9). I thank to your issue! 👍

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

No branches or pull requests

3 participants