encoding - Forcing UTF-8 over cp1252 (Python3) -


i've written code makes use of biopython entrez wrapper. code working fine on previous win10 laptop (python 3.5.1), i've ported code new win10 laptop same versions of every package , python installed , i'm getting decode error.

the traceback error leads function fetches text - it's attempting decode text using cp1252 when should using utf-8. know similar questions have been asked, none have dealt problem happening inside package (biopython in case). copying utf-8 encoding file in python/lib , renaming cp1252.py solves problem, not long term solution.

file "c:\users\arjun\appdata\local\programs\python\python35-32\lib\encodings\cp1252.py", line 23, in decode     return codecs.charmap_decode(input,self.errors,decoding_table)[0]  unicodedecodeerror: 'charmap' codec can't decode byte 0x81 in position 21715: character maps <undefined> 

use io module reading if you're using python 3.x (https://docs.python.org/2/library/io.html#io.open). default, use encoding specified on running platform. can specify own encoding explained in docs.


Comments