Skip to content

Commit 7e3dd4b

Browse files
committed
Switch to Latin1 instead of win-1252 for symbol encoding
1 parent 26d7c90 commit 7e3dd4b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

MiloLib/Classes/Symbol.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ public static Symbol Read(EndianReader reader)
4141
throw new InvalidDataException($"Symbol length is too high: {length}");
4242
}
4343

44-
// use windows-1252 encoding to support extended characters
45-
string value = reader.ReadBytesWithEncoding((int)length, Encoding.GetEncoding("Windows-1252"));
44+
// use Latin1 encoding to support extended characters
45+
string value = reader.ReadBytesWithEncoding((int)length, Encoding.Latin1);
4646
return new Symbol(length, value);
4747
}
4848

4949
public static void Write(EndianWriter writer, Symbol lengthString)
5050
{
5151
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
52-
byte[] bytes = Encoding.GetEncoding("Windows-1252").GetBytes(lengthString.chars);
52+
byte[] bytes = Encoding.Latin1.GetBytes(lengthString.chars);
5353
writer.WriteUInt32((uint)bytes.Length);
5454
writer.WriteBlock(bytes);
5555
}

0 commit comments

Comments
 (0)