Skip to content

Commit

Permalink
Fix non-ascii characters being garbled #19
Browse files Browse the repository at this point in the history
Server encoding might not be UTF-8 but the requests API provides it.
  • Loading branch information
sortega authored and sobjornstad committed Oct 11, 2020
1 parent 86c9a39 commit f02bed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion anki-plugin/src/twimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _download_wiki(url: str, target_location: str) -> None:
r = requests.get(url)
r.raise_for_status()
with open(target_location, 'wb') as f:
f.write(r.text.encode('utf-8'))
f.write(r.text.encode(r.encoding))


def _folderify_wiki(tw_binary: str, wiki_path: str, output_directory: str) -> None:
Expand Down

0 comments on commit f02bed6

Please sign in to comment.