<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But when I enter some Bulgarian (actually cyrillic) text as a string, > it > seems that Python automatically converts it to '\x00..\x00 ' and once > converted that way I can't get it back into its original look. The only > way to get it right is using print : > >>>> a = 'ÌÀÌÀ' # 'Mam' in Bulgarian >>>> print a > 'ÌÀÌÀ' > > but > >>>> a > '\xcc\xe0\xec\xe0'
There is a difference between internal data and external presentation. Print a calls str(a) to get a 'nice' presentation. Echoing 'a' calls repr(a) to get an invertible presentation (eval(repr(somestring)) == somestring). Internally, 'a' is the 4 bytes indicated by the repr presentation, not the 16 chars displayed in that presentation. There is no conversion until that presentation. I cannot comment about wxGrid and how to get it to display the nice version you want. Terry J. Reedy
-- http://mail.python.org/mailman/listinfo/python-list