Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 8
    The link is dead and the gist of the answer wasn't quoted. -1 Commented Jan 11, 2013 at 14:12
  • 1
    When I try the given advice about wrapping sys.stdout, it prints the wrong things. For example, u'\u2013' becomes û instead of an en-dash. Commented Jul 12, 2014 at 22:39
  • @user2357112 You will have to post a new question about that. Unicode and system console is not necessarily the best combination, but I don't know enough about this, so if you need a definite answer, post a question here on SO about it. Commented Jul 13, 2014 at 12:05
  • 2
    the link is dead. The code example is wrong for Windows console where the codepage (OEM) such as cp437 is different from Windows ANSI codepage such as cp1252. The code does not fix UnicodeEncodeError: 'charmap' codec can't encode character error and may lead to mojibake e.g., ا© is silently replaced with ╪º⌐. Commented Aug 24, 2015 at 7:55