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

MRAB python at mrabarnett.plus.com
Sat Oct 13 19:23:57 EDT 2018


On 2018-10-14 00:13, pjmclenon at gmail.com wrote:
> On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote:
>> ​> 1st is this script is from a library module online open source
>> 
>> If it's open source, why didn't you show the link to the soruce?
>> I assume your code is this:
>> 
>> https://github.com/siddharth2010/String-Search/blob/6770c7a1e811a5d812e7f9f7c5c83a12e5b28877/createIndex.py
>> 
>> And self.collFile is opened here:
>> 
>> https://github.com/siddharth2010/String-Search/blob/6770c7a1e811a5d812e7f9f7c5c83a12e5b28877/createIndex.py#L91
>> 
>> You need to add `encoding='utf-8'` argument.
> 
> 
> 
> hello i used this recommandtion in one of my projects in python and it worked fine im wrting today cuz i have this same unicode error in a slighty differn file code line and i added encoding utf 8 but i still get the same error
> 
> here is my line of code
> 
> with open(join("docs", path)) as f:
> 
> where can i add the encoding="utf8" line??
> does anyone on this forum happen to know??
> 
> ok thank you jessica
> 
with open(join("docs", path), encoding="utf-8") as f:



More information about the Python-list mailing list