diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index c61daa0ac6..29e7d1ec8b 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;