Skip to content

Encoding error#4

Open
mihavxc wants to merge 4 commits intokhalilfazal:masterfrom
rrrnld:master
Open

Encoding error#4
mihavxc wants to merge 4 commits intokhalilfazal:masterfrom
rrrnld:master

Conversation

@mihavxc
Copy link

@mihavxc mihavxc commented Oct 21, 2017

In Windows 10 with cyrillic lang I got error:
D:\tmp>python bookmarkstokml.py GoogleBookmarks.html
opening GoogleBookmarks.html
Traceback (most recent call last):
File "bookmarkstokml.py", line 29, in
data = bookmarks_file.read()
File "C:\Program Files\Python\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 9700: character maps to


Solution: Use set encoding UTF:
"with open(filename,encoding="utf8") as bookmarks_file:"

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

Successfully merging this pull request may close these issues.

2 participants