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 when using split_wiki #5

Open
albertvillanova opened this issue Jul 13, 2019 · 0 comments · May be fixed by #6
Open

UnicodeDecodeError when using split_wiki #5

albertvillanova opened this issue Jul 13, 2019 · 0 comments · May be fixed by #6

Comments

@albertvillanova
Copy link

On Windows, a UnicodeDecodeError is raised when using split_wiki:

----> 1 dest = split_wiki(path,lang)

~\projects\forks\course-nlp\nlputils.py in split_wiki(path, lang, encoding)
     46             if f: f.close()
     47             f = (dest/f'{title}.txt').open('w')
---> 48         else: f.write(l)
     49     f.close()
     50     return dest

~\AppData\Local\Continuum\anaconda3\envs\fastai-v1-py37\lib\encodings\cp1252.py in encode(self, input, final)
     17 class IncrementalEncoder(codecs.IncrementalEncoder):
     18     def encode(self, input, final=False):
---> 19         return codecs.charmap_encode(input,self.errors,encoding_table)[0]
     20
     21 class IncrementalDecoder(codecs.IncrementalDecoder):

UnicodeEncodeError: 'charmap' codec can't encode character '\u0103' in position 21: character maps to <undefined>
albertvillanova added a commit to albertvillanova/course-nlp that referenced this issue Jul 13, 2019
On Windows, the default encoding is 'cp1252' and this raises a UnicodeDecodeError.

Fix fastai#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant