fixes of wierd unicode text
This commit is contained in:
parent
59ebb3265c
commit
fb734a2b3a
@ -27,18 +27,6 @@ public class ExBinaryReader : BinaryReader
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExBinaryReader Seek(uint offset, SeekOrigin seekOrigin = SeekOrigin.Begin)
|
|
||||||
{
|
|
||||||
BaseStream.Seek(offset, seekOrigin);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExBinaryReader Seek(long offset, SeekOrigin seekOrigin = SeekOrigin.Begin)
|
|
||||||
{
|
|
||||||
BaseStream.Seek(offset, seekOrigin);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ReadNextUnicodeString() => ReadUnicodeString(ReadInt32());
|
public string ReadNextUnicodeString() => ReadUnicodeString(ReadInt32());
|
||||||
|
|
||||||
public string ReadUnicodeString(int length)
|
public string ReadUnicodeString(int length)
|
||||||
@ -50,7 +38,7 @@ public class ExBinaryReader : BinaryReader
|
|||||||
_ => ReadBytes(doubleLength)
|
_ => ReadBytes(doubleLength)
|
||||||
};
|
};
|
||||||
|
|
||||||
return Encoding.UTF8.GetString(bytes);
|
return Encoding.Unicode.GetString(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadNextAsciiString() => ReadAsciiString(ReadInt32());
|
public string ReadNextAsciiString() => ReadAsciiString(ReadInt32());
|
||||||
|
|||||||
@ -23,7 +23,7 @@ public static class Extensions
|
|||||||
{
|
{
|
||||||
var i = span.Length - 1;
|
var i = span.Length - 1;
|
||||||
while (i > 0 && span[i--] == val) ;
|
while (i > 0 && span[i--] == val) ;
|
||||||
return span;
|
return span[..i];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExBinaryReader NextAsciiStringMustEqual(this ExBinaryReader binReader, string text)
|
public static ExBinaryReader NextAsciiStringMustEqual(this ExBinaryReader binReader, string text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user