1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Made char literal sizes UTF8/UTF16-compatible

This commit is contained in:
Brian Fiete 2020-04-10 08:57:07 -07:00
parent c62854d809
commit e62104a7d1

View file

@ -1917,10 +1917,10 @@ void BfParser::NextToken(int endIdx)
{
mLiteral.mInt64 = (uint8)strLiteral[0];
}
if (mLiteral.mInt64 >= 0x10000)
if (mLiteral.mInt64 >= 0x8000) // Use 0x8000 to remain UTF16-compatible
mLiteral.mTypeCode = BfTypeCode_Char32;
else if (mLiteral.mInt64 >= 0x100)
else if (mLiteral.mInt64 >= 0x80) // Use 0x80 to remain UTF8-compatible
mLiteral.mTypeCode = BfTypeCode_Char16;
}
else