typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Support non-UTF8 encoding on macOS #1337

Open felix-krause opened 6 years ago

felix-krause commented 6 years ago

Howdi,

i have some textiles which are corrupted on my Mac, Typora just shows a lot of Chinese signs. The files have quite a history, once created on notepad++ on a windows machine, they lived through the years on several installations of linuxmint and opensuse, where I usually used plain gedit to edit them. on my Mac they are now In the cloud folder, and the texteditor.app of macOS was able to read them. macOS shows the Umlauts and German special characters as other characters, I am not sure if this behavior is recent. else I would blame the filesystem changes of recent high Sierra update for the corruption.

the macOS console show following file information:

MacBook-2:Folder User$ file -I file.txt 
file.txt: text/plain; charset=iso-8859-1

after copy and paste the file information into typora and saving it in typora it says file.txt: regular file and works perfectly, I have like 50 files to modify that way but I will go ahead anyway

abnerlee commented 6 years ago

i have some textiles which are corrupted on my Mac, Typora just shows a lot of Chinese signs.

Do you mean Typora should be able to open and fix those corrupted files?

From the console log, it seems those files are using iso-8859-1, while Typora only supports utf8/utf16, you would use some tool to convert those files in batch.

felix-krause commented 6 years ago

Actually I thought they are only corrupted in Typora, so yes. But you already answered my question, Typora just doesn't support the encoding of gedit/those files. I was not aware that Typora has limitations on encodings. Sorry for wasting your time and the #1337 on the issue tracker 🍡