almost working, getting some off by one byte errors

This commit is contained in:
989onan
2024-12-14 22:23:37 -05:00
parent 758cf0e760
commit ff4ae71832
3 changed files with 101 additions and 49 deletions
+3 -2
View File
@@ -5,8 +5,9 @@ from io import BytesIO
def ReadCSharp_str(data: BytesIO) -> str:
charamount = read7bitEncoded_int(data)
print(charamount)
return data.read(charamount).decode('utf-8', errors="replace")
string: str = data.read(charamount).decode('utf-8', errors="replace")
print("read string: "+string)
return string
def WriteCSharp_str(data: BytesIO, string: str) -> str:
write7bitEncoded_int(len(string))