From 80cf38447a624fb762b6126f16ba64e89aa29d65 Mon Sep 17 00:00:00 2001 From: Vincent Wilkie Date: Thu, 16 Mar 2017 10:51:03 -0400 Subject: [PATCH] Change default charset when decoding mime parts We can safely decode text mime parts with utf-8 instead of ascii because ascii is just a subset of utf-8 --- flanker/mime/message/headers/wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flanker/mime/message/headers/wrappers.py b/flanker/mime/message/headers/wrappers.py index 6e02a663..e5483d18 100644 --- a/flanker/mime/message/headers/wrappers.py +++ b/flanker/mime/message/headers/wrappers.py @@ -100,7 +100,7 @@ def get_boundary_line(self, final=False): self.get_boundary(), "--" if final else "") def get_charset(self): - default = 'ascii' if self.main == 'text' else None + default = 'utf-8' if self.main == 'text' else None c = self.params.get("charset", default) if c: c = c.lower()