Tkinter wart: returned texts are sometimes strings, sometime Unicode strings

Martin v. Löwis martin at v.loewis.de
Thu Mar 20 16:24:21 EST 2003


Eric Brunel <eric.brunel at pragmadev.com> writes:

> Hi all,
> 
> I stepped again on a problem I had too many times, and I must ask: why
> on earth do Tkinter return plain strings when getting a text value
> using only ASCII charcaters and a Unicode string when the same text
> contains anything else? 

Which part are you questioning?

It returns sometimes ASCII for backwards compatibility: Applications
that were working for English in Python 1.5.2 continue to work.

It returns sometimes Unicode to represent all possible characters.

> Why not return plain strings encoded as UTF-8, for example? 

That may have been an option, but are you seriously proposing to
change that now?

Regards,
Martin




More information about the Python-list mailing list