From c9957321833a517c6d02d0d4fc6f7027bcb9f018 Mon Sep 17 00:00:00 2001 From: nickp Date: Fri, 8 Dec 2023 17:30:39 +0100 Subject: [PATCH] Fix mismatching length for encodings where the byte count and string length are different --- Mutagen.Bethesda.Core/Strings/StringsWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mutagen.Bethesda.Core/Strings/StringsWriter.cs b/Mutagen.Bethesda.Core/Strings/StringsWriter.cs index ab4a1d3eb..a92ed9fa2 100644 --- a/Mutagen.Bethesda.Core/Strings/StringsWriter.cs +++ b/Mutagen.Bethesda.Core/Strings/StringsWriter.cs @@ -165,7 +165,7 @@ private void WriteStrings(List[]> strs, Strin break; case StringsSource.IL: case StringsSource.DL: - writer.Write(item.String.Length + 1); + writer.Write(encoding.GetByteCount(item.String) + 1); writer.Write(item.String, StringBinaryType.NullTerminate, encoding); break; default: