nlp-zero icon indicating copy to clipboard operation
nlp-zero copied to clipboard

should add the encoding="utf8" when read path_or_trie or it will report error

Open wenrui2015 opened this issue 7 years ago • 5 comments

should add the encoding="utf8" when read path_or_trie or it will report error,please check!

wenrui2015 avatar Jun 08 '18 02:06 wenrui2015

but it works well in my ubuntu, both python2 and python3 ~

bojone avatar Jun 23 '18 08:06 bojone

may be you are on linux platform, but in windows platform,the default reading encoding="gbk", so add the encoding="utf8" may more convenient for windows platform user to use your tool.

wenrui2015 avatar Jun 23 '18 09:06 wenrui2015

but "open" has no "encoding" parameter. do you mean using "codecs.open" ?

bojone avatar Jun 23 '18 09:06 bojone

with open(path_or_trie,encoding='utf8') as f: #line 53

wenrui2015 avatar Jun 23 '18 09:06 wenrui2015

with open(path_or_trie,encoding='utf8') as f: #line 53

yes! I have submit a PR.

sanbeichahegongheguo avatar Dec 28 '21 13:12 sanbeichahegongheguo