From ea3d26aafd8f359a725281e4261deec2647a471d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Dec 2018 09:14:23 +0100 Subject: [PATCH] - fixed character to int conversion for UTF8-characters. --- src/scripting/backend/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index c61daa0ac..29e7d1ec8 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -327,7 +327,7 @@ static FxExpression *StringConstToChar(FxExpression *basex) int c = utf8_decode(str.GetChars(), &size); if (c >= 0 && size_t(size) == str.Len()) { - return new FxConstant(str[0], basex->ScriptPosition); + return new FxConstant(c, basex->ScriptPosition); } } return nullptr;