Related post: UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to <undefined>
Hi all, this is my first post and I am sooo sorry if I mess something up and this is a spammy or bad post, but I haven't found any solution to my troubles!
file=open("bookmarks_3_6_17.html",'r')
content=file.read()
print(content)
And this is what I get in return:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Dan\Anaconda3\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 111530: character maps to <undefined>
I did some looking and I saw that maybe the file was encoded in UTF-8, which is what Python assumes by default. I looked around and found nothing to help this error go away. I even tried changing the encoding and using the "encoding" method for "open()" but I got the same error, just in a different position and involving a different encoding file.
Does anyone know how I can fix this? Please let me know if there is any further info I should provide!