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

UnicodeEncodeError: 'charmap' codec can't encode #85

Open
Vyomax opened this issue Dec 5, 2017 · 4 comments
Open

UnicodeEncodeError: 'charmap' codec can't encode #85

Vyomax opened this issue Dec 5, 2017 · 4 comments

Comments

@Vyomax
Copy link

Vyomax commented Dec 5, 2017

[3] "Reducing the dimensionality of data with neur [...] (http://www.cs.toronto.edu/~hinton/science.pdf)
Traceback (most recent call last):
File "download.py", line 102, in
print_title(point.text)
File "download.py", line 50, in print_title
print('\n'.join(("", title, pattern * len(title))))
File "C:\Python27\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\uff08' in position 23: character maps to

@FoxerLee
Copy link

Add encoding='utf8' anywhere in the download.py when it tries to open some file.

@kunalvats
Copy link

At line 87 use this instead:

with open('README.md',encoding='utf8') as readme:
        readme_html = mistune.markdown(readme.read(),encoding='utf8')
        readme_soup = BeautifulSoup.BeautifulSoup(readme_html, "html.parser")

@zylcs
Copy link

zylcs commented Mar 10, 2019

在第87行使用此代替:

with open('README.md',encoding='utf8') as readme:
        readme_html = mistune.markdown(readme.read(),encoding='utf8')
        readme_soup = BeautifulSoup.BeautifulSoup(readme_html, "html.parser")

但仍会出现以下问题
UnicodeDecodeError: 'gbk' codec can't decode byte 0x89 in position 1829: illegal multibyte sequence

@Trenza1ore
Copy link

Maybe it should be 'utf-8' instead of 'utf8' since this is what I tried this morning on my own, and it worked @zylcs

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

5 participants