mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
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:
@@ -72,6 +72,10 @@ CREATE TABLE msgs (
|
||||
timestamp_sent INTEGER DEFAULT 0,
|
||||
timestamp_rcvd INTEGER DEFAULT 0,
|
||||
hidden INTEGER DEFAULT 0,
|
||||
-- mime_headers column actually contains BLOBs, i.e. it may
|
||||
-- contain non-UTF8 MIME messages. TEXT was a bad choice, but
|
||||
-- thanks to SQLite 3 being dynamically typed, there is no need to
|
||||
-- change column type.
|
||||
mime_headers TEXT,
|
||||
mime_in_reply_to TEXT,
|
||||
mime_references TEXT,
|
||||
|
||||
Reference in New Issue
Block a user