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*

6
  • 3
    setdefaultencoding() is nolonger in sys (as of v2.0 according to the module docs). Commented Nov 4, 2008 at 15:53
  • I cannot prove it right now, but I know that I've used this trick on a later version - 2.5 on Windows. Commented Apr 9, 2009 at 21:11
  • 6
    OK, after quite a while I have found out that: "This function is only intended to be used by the site module implementation and, where needed, by sitecustomize. Once used by the site module, it is removed from the sys module’s namespace." Commented May 30, 2009 at 20:43
  • 4
    actually you can set the windows console to be utf-8. you need to say chcp 65001 and it will be unicode. Commented Sep 28, 2010 at 19:25
  • 5
    To make it absolutely clear: it is a is very a bad idea to change the default encoding. This is akin to spalking your broken leg and walking on as if nothing happened, rather than have a doctor set the bone properly. All code handling Unicode text should do so consistently instead of relying on implicit encoding / decoding. Commented Dec 18, 2014 at 23:19