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: 'charmap' codec can't decode byte 0x9d in position 894: character maps to <undefined> #1

Open
SidrahJunaid opened this issue Oct 19, 2017 · 1 comment

Comments

@SidrahJunaid
Copy link

im using Anaconda 3,python 3.5 on windows

@tusharkgerg
Copy link

I had a similar error where ascii codec couldn't decode unicode characters in the file - solved it by reading file as binary and decoding it to ascii. Used the following code for all of the data files
with open(law_data_file, 'rb') as unicodefile:
ufile = unicodefile.read()
asciitext = ufile.decode('ascii','ignore')
law_examples = asciitext.splitlines()

Hope this helps solve your problem.

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

2 participants