ilyachch / md_docs-trans-app

Application for translation documentation in MD format
MIT License
50 stars 14 forks source link

using system default character set might cause problem #60

Open Prepanpan opened 9 months ago

Prepanpan commented 9 months ago

My windows display language was Simplified Chinese before, and that cause trouble. When I input markdown file(usually encoding by utf-8), the application use the system default character set, in my case, GBK, causing error. I switch my display language to English(US) and change default encoding method to utf-8 to solve this, but it's not convenient. I suggest that a function enabling manually choosing .md file's character set could be added.

The error is SIMILAR(not original cause I already switch language and cannot recurrent the error again):

...... File "C:\Python\Python37\lib\pathlib.py", line 1222, in read_text return f.read() UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 118: illegal multibyte sequence

ilyachch commented 9 months ago

Can you attach the file you're trying to translate?

(Or at least some part of it)

Prepanpan commented 9 months ago

test.md Try this. I noticed that it worked well under my current English-as-the-display-language environment. I guess it will probably go wrong again when switching back to Simplified Chinese or whatever else language.