From e62104a7d172bac6ebe252bb4b0a03225dc7dbc2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 10 Apr 2020 08:57:07 -0700 Subject: [PATCH] Made char literal sizes UTF8/UTF16-compatible --- IDEHelper/Compiler/BfParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Compiler/BfParser.cpp b/IDEHelper/Compiler/BfParser.cpp index f3ef6442..8b21aab1 100644 --- a/IDEHelper/Compiler/BfParser.cpp +++ b/IDEHelper/Compiler/BfParser.cpp @@ -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