On approximately 3/23/2009 12:12 PM, came the following characters from the keyboard of Terry Reedy:
Glenn Linderman wrote:
One can set CMD into Unicode mode (chcp 65001)... not sure how Python reacts to that either. But even then...
I tried that and others have reported doing so on python-list but no one has gotten that to work.
import ctypes k=ctypes.WinDLL('kernel32') x = k.SetConsoleOutputCP(65001) if x!= 1: print("x was ", x ) exit( 1 ) print (''.join(chr(i) for i in range(0x410, 0x430)).encode('utf-8'))
produces a nice b'\xd0\x90\d0\x91....' stream of hex representations of UTF-8 encoded Unicode characters...
The only thing that seems to be missing is that Python won't emit them to the screen that way.
So surely some python-dev that is smarter than me, could provide that magic incantation. Will go search, but that isn't in my current knowledge banks.