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.


http://support.microsoft.com/kb/247815
http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en

(python 3)

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.

--
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to remove.
-- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to