Commit 8a364995 authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'wip/225-gmime-charset-crash' into 'master'

Fix crash in Geary.RFC822.init()

Closes #225

See merge request !125
parents 288178b5 e06ec5e7
Pipeline #61199 failed with stages
in 34 minutes and 46 seconds
......@@ -19,11 +19,6 @@ public enum TextFormat {
*/
public const string UTF8_CHARSET = "UTF-8";
// This has the effect of ensuring all non US-ASCII and non-ISO-8859-1
// headers are always encoded as UTF-8. This should be fine because
// message bodies are also always sent as UTF-8.
private const string[] USER_CHARSETS = { UTF8_CHARSET };
private int init_count = 0;
internal Regex? invalid_filename_character_re = null;
......@@ -33,6 +28,16 @@ public void init() {
return;
GMime.init(GMime.ENABLE_RFC2047_WORKAROUNDS);
// This has the effect of ensuring all non US-ASCII and non-ISO-8859-1
// headers are always encoded as UTF-8. This should be fine because
// message bodies are also always sent as UTF-8.
const string?[] USER_CHARSETS = {
UTF8_CHARSET,
// GMime.set_user_charsets calls g_strdupv under the hood, so
// the array needs to be null-terminated
null
};
GMime.set_user_charsets(USER_CHARSETS);
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment