Python, Unicode, and the Windows console

Posted by James Sulak on Stack Overflow See other posts from Stack Overflow or by James Sulak
Published on 2008-08-07T22:26:58Z Indexed on 2010/03/11 18:14 UTC
Read the original article Hit count: 292

Filed under:
|

When I try to print a Unicode string in a windows console, I get a "UnicodeEncodeError: 'charmap' codec can't encode character ...." error. I assume this is because the Windows console does not accept Unicode-only characters. What's the best way around this? Is there any way I can make Python automatically print a "?" instead of failing in this situation?

Edit: I'm using Python 2.5.

© Stack Overflow or respective owner

Related posts about python

Related posts about unicode