diff --git a/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java b/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java index f7d7cc21a..0a0cc7c54 100644 --- a/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java +++ b/common/src/main/java/org/figuramc/figura/parsers/LuaScriptBuilderVisitor.java @@ -294,7 +294,7 @@ public void visit(Exp.BinopExp exp) { public void visit(Exp.Constant exp) { LuaValue value = exp.value; if (value instanceof LuaString str) { - String input = new String(str.m_bytes, StandardCharsets.UTF_8); + String input = new String(str.m_bytes, str.m_offset, str.m_length, StandardCharsets.UTF_8); int sdq = 0; for (char c : input.toCharArray()) { if (c == '\'') sdq--;