[FIX] mail: UTF-8 text/xml attachment and omitted charset
When parsing an email containing an xml attachment, the `email` python module will decode the base64 attachment using the charset or ascii if the charset is missing. In some cases, the payload is in UTF-8 but the charset is omitted. This results in replacement characters for the non ASCII characters. The solution is to force the charset to UTF-8, since it is a superset of ASCII that should not be a problem. NB1: Omitting the charset for text/xml is not recommended. See the RFC (section 6.4): https://www.ietf.org/rfc/rfc2376.txt opw-3144519 closes odoo/odoo#125628 Signed-off-by:Julien Castiaux (juc) <juc@odoo.com>
Showing
- addons/mail/models/mail_thread.py 4 additions, 0 deletionsaddons/mail/models/mail_thread.py
- addons/test_mail/data/test_mail_data.py 44 additions, 0 deletionsaddons/test_mail/data/test_mail_data.py
- addons/test_mail/tests/test_mail_gateway.py 7 additions, 0 deletionsaddons/test_mail/tests/test_mail_gateway.py
Loading