Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for Emojis in tkinter #77044

Closed
VictorDomingos mannequin opened this issue Feb 17, 2018 · 3 comments
Closed

Missing support for Emojis in tkinter #77044

VictorDomingos mannequin opened this issue Feb 17, 2018 · 3 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes OS-mac topic-tkinter topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@VictorDomingos
Copy link
Mannequin

VictorDomingos mannequin commented Feb 17, 2018

BPO 32863
Nosy @ronaldoussoren, @vstinner, @ned-deily, @ezio-melotti, @serhiy-storchaka

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2018-02-18.09:44:10.281>
created_at = <Date 2018-02-17.13:42:30.250>
labels = ['OS-mac', 'type-bug', 'expert-tkinter', '3.8', '3.7', 'expert-unicode']
title = 'Missing support for Emojis in tkinter'
updated_at = <Date 2018-02-20.21:24:28.390>
user = 'https://bugs.python.org/VictorDomingos'

bugs.python.org fields:

activity = <Date 2018-02-20.21:24:28.390>
actor = 'ronaldoussoren'
assignee = 'none'
closed = True
closed_date = <Date 2018-02-18.09:44:10.281>
closer = 'serhiy.storchaka'
components = ['macOS', 'Tkinter', 'Unicode']
creation = <Date 2018-02-17.13:42:30.250>
creator = 'Victor Domingos'
dependencies = []
files = []
hgrepos = []
issue_num = 32863
keywords = []
message_count = 3.0
messages = ['312279', '312302', '312437']
nosy_count = 7.0
nosy_names = ['ronaldoussoren', 'vstinner', 'gpolo', 'ned.deily', 'ezio.melotti', 'serhiy.storchaka', 'Victor Domingos']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue32863'
versions = ['Python 3.7', 'Python 3.8']

@VictorDomingos
Copy link
Mannequin Author

VictorDomingos mannequin commented Feb 17, 2018

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

@VictorDomingos VictorDomingos mannequin added 3.7 (EOL) end of life 3.8 only security fixes OS-mac topic-tkinter topic-unicode type-bug An unexpected behavior, bug, or error labels Feb 17, 2018
@serhiy-storchaka
Copy link
Member

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.

@ronaldoussoren
Copy link
Contributor

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).

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes OS-mac topic-tkinter topic-unicode type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants