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

windows下使用有编码问题 #7

Open
yiqiyu opened this issue Aug 3, 2020 · 3 comments
Open

windows下使用有编码问题 #7

yiqiyu opened this issue Aug 3, 2020 · 3 comments

Comments

@yiqiyu
Copy link

yiqiyu commented Aug 3, 2020

Traceback (most recent call last): File "D:/projects/miscellaneous/test.py", line 5, in <module> ws_tool = WordSimilarity2010() File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 101, in __init__ super(WordSimilarity2010, self).__init__() File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 20, in __init__ self._load_cilin(t_cilin_path) File "C:\Users\00015426\AppData\Local\Programs\Python\Python37\lib\site-packages\word_similarity\__init__.py", line 45, in _load_cilin line = file_obj.readline() UnicodeDecodeError: 'gbk' codec can't decode byte 0xba in position 11: illegal multibyte sequence

希望作者可以增加编码兼容,比如说file_obj = open(file_path, 'r', encoding="utf-8")

@JackiyWu
Copy link

同有问题

@cccccrj
Copy link

cccccrj commented Mar 12, 2021

@lagrahhn
Copy link

在源码的第41行,
改为file_obj = open(file_path, 'r',encoding='utf-8')

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

No branches or pull requests

4 participants