mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Made char literal sizes UTF8/UTF16-compatible
This commit is contained in:
parent
c62854d809
commit
e62104a7d1
1 changed files with 3 additions and 3 deletions
|
@ -1917,10 +1917,10 @@ void BfParser::NextToken(int endIdx)
|
||||||
{
|
{
|
||||||
mLiteral.mInt64 = (uint8)strLiteral[0];
|
mLiteral.mInt64 = (uint8)strLiteral[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mLiteral.mInt64 >= 0x10000)
|
if (mLiteral.mInt64 >= 0x8000) // Use 0x8000 to remain UTF16-compatible
|
||||||
mLiteral.mTypeCode = BfTypeCode_Char32;
|
mLiteral.mTypeCode = BfTypeCode_Char32;
|
||||||
else if (mLiteral.mInt64 >= 0x100)
|
else if (mLiteral.mInt64 >= 0x80) // Use 0x80 to remain UTF8-compatible
|
||||||
mLiteral.mTypeCode = BfTypeCode_Char16;
|
mLiteral.mTypeCode = BfTypeCode_Char16;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue