mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-19 11:46:26 +00:00
fix utf8 encoding when writing to database
This commit is contained in:
@@ -35,6 +35,7 @@ import Simplex.Messaging.Agent.Store.SQLite (fromTextField_)
|
||||
import Simplex.Messaging.Encoding.String
|
||||
import Simplex.Messaging.Parsers (dropPrefix, enumJSON, sumTypeJSON)
|
||||
import Simplex.Messaging.Protocol (MsgBody)
|
||||
import Simplex.Chat.Util (safeDecodeUtf8)
|
||||
|
||||
data ChatType = CTDirect | CTGroup | CTContactRequest
|
||||
deriving (Show, Generic)
|
||||
@@ -215,7 +216,7 @@ ciContentToText = \case
|
||||
CIRcvFileInvitation RcvFileTransfer {fileInvitation = FileInvitation {fileName}} -> "file " <> T.pack fileName
|
||||
|
||||
instance ToField (CIContent d) where
|
||||
toField = toField . decodeLatin1 . LB.toStrict . J.encode
|
||||
toField = toField . safeDecodeUtf8 . LB.toStrict . J.encode
|
||||
|
||||
instance ToJSON (CIContent d) where
|
||||
toJSON = J.toJSON . jsonCIContent
|
||||
|
||||
Reference in New Issue
Block a user