PyEdit generates additional pop-up windows—including transient Goto and Find di-
alogs, color selection dialogs, dialogs that appear to collect arguments and modes for
Run Code, and dialogs that prompt for entry of Unicode encoding names on file Open
and Save if PyEdit is configured to ask (more on this ahead). In the interest of space,
I’ll leave most other such behavior for you to witness live.
Prominently new in this edition, though, and subject to user configurations, PyEdit
may ask for a file’s Unicode encoding name when opening a file, saving a new file begun
from scratch, or running a Save As operation. For example, Figure 11-5 captures the
scene after I’ve opened a file encoded in a Chinese character set scheme and pressed
Open again to open a new file encoded in a Russian encoding. The encoding name
input dialog shown in the figure appears immediately after the standard file selection
dialog is dismissed, and it is prefilled with the default encoding choice configured (an
explicit setting or the platform’s default). The displayed default can be accepted in most
cases, unless you know the file’s encoding differs.
In general, PyEdit supports any Unicode character set that Python and tkinter do, for
opens, display, and saves. The text in Figure 11-5, for instance, was encoding in a
specific Chinese encoding in the file it came from (“gb2321” for file email-part--
gb2312). An alternative UTF-8 encoding of this text is available in the same directory
(file email-part--gb2312--utf8) which works per the default Windows encoding in
PyEdit and Notepad, but the specific Chinese encoding file requires the explicitly
Figure 11-4. Multiple PyEdit windows in a single process
680 | Chapter 11: Complete GUI Programs