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:
parent
5fd9552331
commit
cf6ade5e45
4 changed files with 8 additions and 11 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue