1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Fixed UTF16/32 encoding issues regarding null termination

This commit is contained in:
Brian Fiete 2022-04-22 18:34:17 -07:00
parent 5fd9552331
commit cf6ade5e45
4 changed files with 8 additions and 11 deletions

View file

@ -170,7 +170,6 @@ namespace System.Text
else
len += 2;
}
len++; // null terminator
return len;
}
@ -223,7 +222,6 @@ namespace System.Text
EncodeChar((char16)(valLeft & 0x3FF) + 0xDC00);
}
}
EncodeChar(0);
int encodedLen = bufLen - bufLeft;
if (bufLeft < 0)

View file

@ -106,7 +106,6 @@ namespace System.Text
{
len++;
}
len++; // null terminator
return len;
}
@ -132,10 +131,8 @@ namespace System.Text
for (var c in str.DecodedChars)
{
EncodeChar((char32)c);
}
EncodeChar(0);
int encodedLen = bufLen - bufLeft;
if (bufLeft < 0)