<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Note that on Python 2.6 it works:<br>
<br>
Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit<br>
<div class="Ih2E3d">(Intel)] on<br>
win32<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
</div>>>> print unicode('\u20ac')<br>
\u20ac<br>
</blockquote><div><br>Note that in Python 2.6 it expressly *does not* work, by your own example. Although I think the example is wrong and that you need to print u'\u20ac' in 2.6 unless you are importing unicode_literals from __future__; otherwise  '\u20ac' is an ASCII string of 6 characters.<br>
<br>"Works" would result, I'd think, in a unicode character being actually written to stdout: that is not happening. Instead a backslash pattern of ASCII characters meant to represent a Unicode character that -can't- be written to that stream are being written to stdout. The two aren't even kind of the same: but this is hardly something Python has a lot of control over... Windows software printing unicode to stdout was always a bit broken. IF you set the code page you could print some -- and IF you changed the font on the command prompt to a /non/-default font you could actually display others -- but it really is sort of a sucky situation, Unicode in Console windows on Windows.<br>
<br>I really don't know how Python could do it better here: between the default code page on Windows being completely lame, the default font not supporting Unicode really... ISTM that having cross-platform apps which output unicode (really UTF8 probably) to stdout are just not really doable. But if you really want to you can always rebind sys.stdout with an error mode of "backslashreplace" or "xmlcharrefreplace" (which I do in one situation where I have a subprocess that has to output 'unicode' to a parent process) instead of 'strict'.<br>
<br>--Stephen<br></div></div><br>