Skip to content

Instantly share code, notes, and snippets.

@hgirish
Last active May 26, 2017 02:00
Show Gist options
  • Save hgirish/802c809c7b9bb4279f6fdd9d7f34cbe3 to your computer and use it in GitHub Desktop.
Save hgirish/802c809c7b9bb4279f6fdd9d7f34cbe3 to your computer and use it in GitHub Desktop.
Windows UnicodeEncodeError: 'charmap' codec can't encode character
# taken from https://forum.sublimetext.com/t/windows-st3-python-3-unicode-output/15261/4
import sys
from io import TextIOWrapper
sys.stdout = TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment