Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix encoding issue on Windows #1

Merged
merged 1 commit into from
Jun 8, 2019

Conversation

invisiblearts
Copy link
Contributor

对于 Windows (以及某些情况下的 Linux),python 默认使用的编码并不是 utf-8。

顺带一提,似乎现在版本的后端引入了一些 bug。

@invisiblearts
Copy link
Contributor Author

又想了一下,问题主要出在参考的 txt 文件编码是 utf-8,于是用大部分编辑软件后会继续自动保存为 utf-8;然而如果编辑空的那个文件,保存后的编码却又会变成系统的默认编码。所以大概还是有问题……

@invisiblearts
Copy link
Contributor Author

在某个版本的 Windows 后,记事本的默认保存编码已经是没有 BOM 的 utf-8(反倒和系统的 code page 脱钩),所以不会再有问题了。
猜测纯文本文件的编码始终是个难题,因此或许在文档里反映会更好一些。

Copy link
Collaborator

@ycremar ycremar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ycremar ycremar merged commit 472e844 into penguin-statistics:master Jun 8, 2019
@invisiblearts invisiblearts deleted the fix_codecs branch June 8, 2019 05:48
GalvinGao added a commit that referenced this pull request May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants