Deep-Learning-Papers-Reading-Roadmap icon indicating copy to clipboard operation
Deep-Learning-Papers-Reading-Roadmap copied to clipboard

UnicodeEncodeError: 'charmap' codec can't encode

Open Vyomax opened this issue 7 years ago • 4 comments

[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

Vyomax avatar Dec 05 '17 15:12 Vyomax

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

FoxerLee avatar Aug 29 '18 09:08 FoxerLee

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")

kunalvats avatar Sep 06 '18 20:09 kunalvats

在第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

zylcs avatar Mar 10 '19 11:03 zylcs

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

Trenza1ore avatar Jun 10 '19 12:06 Trenza1ore