A
A
ArtiomK2019-06-19 15:35:21
Python
ArtiomK, 2019-06-19 15:35:21

How to fix incorrect encoding of non-English characters (Cyrillic) when uploading a project with an archive from github?

I encountered the following problem: when I upload my project that contains Cyrillic archive from github, I get some gibberish in the application GUI if encoding # coding=cp866 is specified at the beginning of the file, if I specify cp1251 encoding, I get an error SyntaxError: encoding problem: cp1251. If I just copy the files from PyCharm and put them in any folder on my PC, then there is no problem. Perhaps I somehow incorrectly copy my code on Github - I copy paste the file with Pycharm and paste it into the desired Github file.
The problem can be circumvented by copy-pasting the file on Github (cp1251 encoding), copying it to notepad and saving it as a py file.
https://github.com/ArtyomKozyrev1989/workingtime_c...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2019-06-20
@ArtiomK

GitHub serves files in UTF-8 encoding. Judging by the fact that the commits are signed with a github key, I assume that you are editing files directly on the github site.
The two options I see are:

  • Push all files via git, this should upload files in their original encoding
  • Use UTF-8 by default in the project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question