Closed sieveLau closed 3 years ago
报错是这样:
> python hugo-encryptor.py || exit Traceback (most recent call last): File "hugo-encryptor.py", line 133, in <module> f.write(str(soup)) UnicodeEncodeError: 'gbk' codec can't encode character '\xa9' in position 2259: illegal multibyte sequence
查了一下,在hugo-encryptor.py的131行的with open(fullpath, 'w') as f:里面加encoding="utf-8",变成:
with open(fullpath, 'w') as f:
encoding="utf-8"
with open(fullpath, 'w',encoding="utf-8") as f: html = str(soup) f.write(str(soup))
以及166行的open也同样加一个encoding,就不报错了。
这个问题与 #6 是同一个问题,提交了一个pull request
已merge。感谢反馈。
报错是这样:
查了一下,在hugo-encryptor.py的131行的
with open(fullpath, 'w') as f:
里面加encoding="utf-8"
,变成:以及166行的open也同样加一个encoding,就不报错了。