Store mime_headers as BLOBs

Raw MIME messages may contain non-ASCII characters. Attempting to
store them as TEXT by using String::from_utf8_lossy results in
non-ASCII characters being replaced with Unicode U+FFFD "REPLACEMENT
CHARACTER" which is later incorrectly decoded when attempting to parse
`mime_headers` content into HTML.
This commit is contained in:
link2xt
2021-06-19 01:22:08 +03:00
parent c08df8d3da
commit a47c0486ae
6 changed files with 87 additions and 21 deletions

View File

@@ -0,0 +1,18 @@
Subject: test non-utf8 and dc_get_msg_html()
To: tunis4 <tunis4@testrun.org>
From: "B. Petersen" <bpetersen@b44t.com>
Message-ID: <00007126-1efa-290b-2120-200251f50f23@b44t.com>
Date: Thu, 27 May 2021 17:33:16 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
foo bar <20> <20> <20> <20>
-------- Forwarded Message --------
Subject: Foo
Date: Fri, 21 May 2021 08:42:20 +0000
just to force a "more button"