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
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.
NB this will probably want to wait for the GMime 3.0 port to land before proceeding.