Browse Source
Fix: message.MessageContent can have special characters which breaks saving to csv. -> Need to utf-8 encode
Signed-off-by: CptSaulGoodman <35928982+MiDoTr@users.noreply.github.com>
pull/280/head
CptSaulGoodman
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
1 deletions
-
src/pkg/utils/chat_storage.go
|
|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
"fmt" |
|
|
|
"os" |
|
|
|
"sync" |
|
|
|
"net/url" |
|
|
|
|
|
|
|
"github.com/aldinokemal/go-whatsapp-web-multidevice/config" |
|
|
|
) |
|
|
|
@ -79,7 +80,9 @@ func RecordMessage(messageID string, senderJID string, messageContent string) er |
|
|
|
} |
|
|
|
|
|
|
|
// Prepare the new record
|
|
|
|
newRecord := []string{message.MessageID, message.JID, message.MessageContent} |
|
|
|
// Fix: message.MessageContent can have special characters which breaks saving to csv. -> Need to utf-8 encode
|
|
|
|
encodedMessageContent := url.QueryEscape(message.MessageContent) |
|
|
|
newRecord := []string{message.MessageID, message.JID, encodedMessageContent} |
|
|
|
records = append([][]string{newRecord}, records...) // Prepend new message
|
|
|
|
|
|
|
|
// Write all records back to file
|
|
|
|
|