Message headers are similarly encoded per UTF-8 if they are non-ASCII when sent, so
they will work in the full email text. In fact, if you study this closely you’ll find that the
Subject here was originally encoded per a Russian Unicode scheme but is UTF-8 now—
its new representation yields the same characters (code points) when decoded for
display.
In short, although the GUI itself is still in English (its labels and the like), the content
of emails displayed and sent support arbitrary character sets. Decoding for display is
done per content where possible, using message headers for text payloads and content
for headers. Encoding for sends is performed according to user settings and policies,
using user settings or inputs, or a UTF-8 default. Required MIME and email header
encodings are implemented in a largely automatic fashion by the underlying email
package.
Not shown here are the pop-up dialogs that may be issued to prompt for text part
encoding preferences on sends if so configured in mailconfig, and PyEdit’s similar
prompts under certain user configurations. Some of these user configurations are meant
for illustration and generality; the presets seem to work well for most scenarios I’ve run
into, but your International mileage may vary. For more details, experiment with the
file’s messages on your own and see the system’s source code.
Figure 14-43. Result of reply and forward with International character sets, re-decoded
1058 | Chapter 14: The PyMailGUI Client
Do
wnload from Wow! eBook <www.wowebook.com>