Typesafe message data handling and conversion
Currently, Geary uses the GLib string
type to represent both wire-encoded (typically 7-bit US-ASCII for IMAP, and 7 or 8-bit for SMTP) and decoded (i.e. UTF-8) strings. This makes it difficult to tell which data is in what form, and is likely leading to various decoding, encoding, and display bugs.
All classes that encapsulate wire-encoded data (e.g. the RFC822
classes and descendants of Imap.Parameter
) should be constructed and store data as GLib.Bytes
(i.e. GBytes
) instances, with a required encoding parameter to specify the format of the bytes. This can then have its encoding validated, and converted to/from string
for internal manipulation and display.
Along the way, known encoding and display issues should be addressed as well, such as bgo 713071, bgo 714915, and bgo 758380.