This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing support for Emojis in tkinter
Type: behavior Stage: resolved
Components: macOS, Tkinter, Unicode Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Victor Domingos, ezio.melotti, gpolo, ned.deily, ronaldoussoren, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2018-02-17 13:42 by Victor Domingos, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg312279 - (view) Author: Victor Domingos (Victor Domingos) * Date: 2018-02-17 13:42
In the current Python 3.7.0b1, on macOS 10.12.6 Sierra (also on 10.11 El Capitan), which seems to include a newer Tcl/tk version, it still does not support a variety of UTF characters, including Emoji characters that nowadays are of very common use. A quick search on the web returns some hints that maybe Tcl/tk could be compiled with different options in order to unlock those characters:

http://wiki.tcl.tk/515
https://core.tcl.tk/tk/tktview/6c0d7aec6713ab6a7c3e12dff7f26bff4679bc9d

I am not sure if it is officially supported by now, but at least for me, as a Python and tkinter user, it would be a great improvement.

Thanks in advance,

With best regards,
Victor Domingos


My current version:

Python 3.7.0b1 (v3.7.0b1:9561d7f501, Jan 30 2018, 19:10:11) 
[Clang 6.0 (clang-600.0.57)] on darwin


Sample code that fails:

import tkinter as tk
import tkinter.ttk as ttk
app = tk.Tk()
b = ttk.Button(app, text="📩")


-------

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py", line 614, in __init__
    Widget.__init__(self, master, "ttk::button", kw)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py", line 559, in __init__
    tkinter.Widget.__init__(self, master, widgetname, kw=kw)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2293, in __init__
    (widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: character U+1f4e9 is above the range (U+0000-U+FFFF) allowed by Tcl
msg312302 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-18 09:44
AFAIK, the build with more than 16-bit characters is not well tested and not officially supported and may need patching other code. Supporting the fork of Tcl/Tk is out of the competency of the Python core development team. If you have successful experience with building and using Tcl/Tk with full Unicode support I suggest you to achieve the official status of this build and promote its distribution.
msg312437 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2018-02-20 21:24
The 3.7b1 64-bit installer includes a local copy of Tcl/Tk (see Mac/BuildScript/build-installer.py), which could be changed as needed. That said, I'm not advocating changing default Tcl/Tk configuration options because I don't know how well full unicode builds are supported (and if that would fix anything).

<https://core.tcl.tk/tk/info/00a27923ee26437611e1ed83f96e15b6caabcd8b> seems to indicate that at least one emoji related issue has been fixed very recently in Tk (later than the latest Tcl/Tk release).
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 77044
2018-02-20 21:24:28ronaldoussorensetmessages: + msg312437
2018-02-18 09:44:10serhiy.storchakasetstatus: open -> closed
resolution: third party
messages: + msg312302

stage: resolved
2018-02-17 13:42:30Victor Domingoscreate