Why can't some characters be entered in Python IDLE?

I don’t know how to explain this, I’m actually looking for an explanation, so I just mentioned a few steps to reproduce the problem. Hope someone can understand and clarify:

  • Python 3.5.0 for Windows 8.1. (However, this should be reproducible, regardless of the version of Python or Windows.)
  • The Persian standard keyboard is installed. (You can download it from here . Again, I’m sure that the problem is not limited to this particular keyboard, and in some other languages ​​there are some characters that have the same problem. Just for the sake of reproducibility.)
  • Open IDLE, set the keyboard layout to Persian and enter a few characters.
  • For some characters, such as "آ" (Shift + h). They are typed perfectly.
  • For some other characters, such as 'ی' (d). They are converted to a similar character, in this case "ي" (note the small dots under the glyph).
  • There are some characters that cannot be entered. For example, "﷼" (Shift + 4). They are printed as '?' in IDLE.
  • All of the above characters can be entered into almost any other program that I installed. One of the easiest is notepad.exe.
  • We can enter the same characters in another program, for example. notepad.exe, then copy and paste them into IDLE. This shows that IDLE supports Unicode characters, just cannot enter them.

IDLE. IDE, Python, IDE - . IDLE. , , IDLE, , - copy-paste.

:

  • ? ?
  • ?
  • , .

:

>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'cp1256')
>>> locale.getpreferredencoding()
'cp1256'
>>> locale.getlocale()
('English_United States', '1252')
>>> 
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'

.

Update:

. . , WindowsBestFit tkinter.

, - python/tkinter tcl/tk, Tkabber. , Tcl/Tk. , , .. , . , tcl/tk, IDLE/Python/tkinter.

.

+4
1

Tk bug tracker. , . TCL/TK UTF-8.

, 2014-09-18 , . , , Windows ( ), , - (, ).

IMO, TCL/TK. Tcl/Tk , Unicode Windows.

+4

Source: https://habr.com/ru/post/1618768/


All Articles