On Tue, Dec 17, 2013 at 01:36:43AM -0800, Igor Korot wrote: > Hi, guys, > > On Tue, Dec 17, 2013 at 1:29 AM, Steven D'Aprano <st...@pearwood.info> wrote: > > On Mon, 16 Dec 2013 23:58:15 -0800, wxjmfauth wrote: > I think you are doing exactly what Steven D'Aprano said:
Please compare: "abc" vs 'abc' from wxPython point of view. Also remember that wxPython is a wrapper around C++ library where string are usually defined with double quotes. Thank you. > > > >> From all the toolkits, wxPython is probably the most interesting. I used > >> all versions from 2.0 (?) up to 2.8. Then it has been decided to go > >> unicode. > >> > >> Let see in the wx interactive intepreter, it is only the top of the > >> iceberg. (Py27, wxPy294) > >> > >>>>> len('ሴЃ') > >> 5 > > > > > > What does that have to do with wxPython? It looks like you're just mis- > > using Python 2.7. > > > > In Python 2.7, 'ሴЃ' is not a Unicode string, it is a byte string. The > > exact bytes you get are not well-defined but on many systems you may get > > a UTF-8 encoded byte string: > > > > > > py> sys.version > > '2.7.4 (default, Apr 18 2013, 17:48:59) \n[GCC 4.4.5]' > > py> for b in 'ሴЃ': > > ... print hex(ord(b)), b > > ... > > 0xe1 > > 0x88 � > > 0xb4 � > > 0xd0 > > 0x83 � > > > > > > If you use a Unicode string instead: > > > > py> for c in u'ሴЃ': > > ... print hex(ord(c)), c > > ... > > 0x1234 ሴ > > 0x403 Ѓ > > > > py> for b in u'ሴЃ'.encode('utf-8'): > > ... print hex(ord(b)), b > > ... > > 0xe1 > > 0x88 � > > 0xb4 � > > 0xd0 > > 0x83 � > > > > > > > > Even if it is true that wxPython cannot handle Unicode text, you haven't > > shown it here. > > > > > > > > -- > > Steven > > -- > > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list