[Python-ideas] Add str.bmp() to only expand non-BMP chars, for tkinter use

random832 at fastmail.us random832 at fastmail.us
Mon Mar 16 14:55:59 CET 2015


On Sun, Mar 15, 2015, at 19:09, Terry Reedy wrote:
> Tk widgets ... support the full BMP subset of unicode.

Is it actually true that Tk widgets cannot support non-BMP characters?
On my Python 2.7 on Windows (which is a narrow build, and therefore is
passing in a UTF-16 string containing surrogates), it appears to work
just fine. The character itself appears as a box, because there is no
font support, but it is one box, not two. It seems like on the versions
where people are getting the error message, Tkinter is arbitrarily (i.e.
not based on a real limitation in Tk) refusing to convert extended
characters to surrogates.


More information about the Python-ideas mailing list