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

UnicodeDecodeError #3

Open
lsih opened this issue Aug 26, 2019 · 3 comments
Open

UnicodeDecodeError #3

lsih opened this issue Aug 26, 2019 · 3 comments

Comments

@lsih
Copy link

lsih commented Aug 26, 2019

UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 8: illegal multibyte sequence

@da-liii
Copy link
Owner

da-liii commented Aug 26, 2019

How to reproduce it?

@lsih
Copy link
Author

lsih commented Aug 26, 2019

python3 generate.py -t kindle
I will generate shiji.epub for Kindle
Converting the source file to Markdown format...
Traceback (most recent call last):
File "D:\Download\shiji-master\generate.py", line 175, in
convert(i, save)
File "D:\Download\shiji-master\generate.py", line 29, in convert
content = getLine(data)
File "D:\Download\shiji-master\generate.py", line 11, in getLine
for line in data:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 8: illegal multibyte sequence

@cuixiping
Copy link

You should add encoding parameter to all open(...) calls. For example

fout = open(filename, "w", 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

3 participants