cnn_text_classification icon indicating copy to clipboard operation
cnn_text_classification copied to clipboard

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 894: character maps to <undefined>

Open SidrahJunaid opened this issue 7 years ago • 1 comments

im using Anaconda 3,python 3.5 on windows

SidrahJunaid avatar Oct 19 '17 04:10 SidrahJunaid

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.

tusharkgerg avatar Jan 05 '18 12:01 tusharkgerg