From f6f73096e09d4a35c4ae167c46919e20d3bfc29d Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Thu, 22 Dec 2022 02:52:39 +0100 Subject: [PATCH] replace invalid utf8 chars in text messages --- csgo/demo_parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csgo/demo_parser.go b/csgo/demo_parser.go index dd774b0..97b89c6 100644 --- a/csgo/demo_parser.go +++ b/csgo/demo_parser.go @@ -17,6 +17,7 @@ import ( log "github.com/sirupsen/logrus" "io" "net/http" + "strings" "time" ) @@ -563,7 +564,7 @@ workloop: var bulk []*ent.MessagesCreate for _, msg := range tMatchPlayer.Edges.Messages { bulk = append(bulk, tx.Messages.Create(). - SetMessage(msg.Message). + SetMessage(strings.ToValidUTF8(msg.Message, "")). SetAllChat(msg.AllChat). SetTick(msg.Tick). SetMatchPlayer(tMatchPlayer))