From 0fcf68632dbbd5c816967fe784d405047b7877f2 Mon Sep 17 00:00:00 2001 From: Linblow <8434205+Linblow@users.noreply.github.com> Date: Mon, 26 Jul 2021 11:47:21 +0200 Subject: [PATCH] Detect CwCheat file UTF-8 BOM sequence and ignore it --- Core/CwCheat.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 0a348cf089..d1a12f98d6 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -98,6 +98,9 @@ bool CheatFileParser::Parse() { if (!tempLine) continue; + // Detect UTF-8 BOM sequence, and ignore it. + if (line_ == 1 && memcmp(tempLine, "\xEF\xBB\xBF", 3) == 0) + tempLine += 3; std::string line = TrimString(tempLine); // Minimum length 5 is shortest possible _ lines name of the game "_G N+"