Terry J. Reedy added the comment:

Eryk> I tried print(transurrogate(s)) from editor and it worked!, printing '🔫 
🔪' (though not near as pretty as here in Firefox.

I have previously thought of scanning strings before inserting into Text 
widgets and converting astral chars to \U000nnnnn form, with a color tag to 
distinguish such displays from the literal ten chars.   This should work fine 
for read-only output to Shell but not easily in Editor.  On Windows, I would 
just use transurrogate instead, and that would also work for loading files into 
the editor.

I believe transurrogate could potentially solve pasting on Windows by 
intercepting <<Paste>> events.

Serhiy, are you aware of Eryk's astral char workaround for Windows?  Could it 
be incorporated into _tkinter, where a string's kind is accessible?

----------
nosy: +serhiy.storchaka
versions: +Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30019>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to