Skip to content

Commit 26d7c90

Browse files
committed
Register encoding provider on symbol write too
i need to move this somewhere else eventually
1 parent f88a063 commit 26d7c90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

MiloLib/Classes/Symbol.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ public override string ToString()
2929
return chars;
3030
}
3131

32+
// TODO: move the register provider to a more global place, this is shit
33+
3234
public static Symbol Read(EndianReader reader)
3335
{
3436
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
35-
3637
uint length = reader.ReadUInt32();
3738

3839
if (length > 512)
@@ -47,6 +48,7 @@ public static Symbol Read(EndianReader reader)
4748

4849
public static void Write(EndianWriter writer, Symbol lengthString)
4950
{
51+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
5052
byte[] bytes = Encoding.GetEncoding("Windows-1252").GetBytes(lengthString.chars);
5153
writer.WriteUInt32((uint)bytes.Length);
5254
writer.WriteBlock(bytes);

0 commit comments

Comments
 (0)