|
|
@@ -1,6 +1,4 @@
|
|
|
|
|
|
-using System.Text;
|
|
|
-
|
|
|
namespace Lua.Standard.Text;
|
|
|
|
|
|
public sealed class LenFunction : LuaFunction
|
|
|
@@ -11,7 +9,7 @@ public sealed class LenFunction : LuaFunction
|
|
|
protected override ValueTask<int> InvokeAsyncCore(LuaFunctionExecutionContext context, Memory<LuaValue> buffer, CancellationToken cancellationToken)
|
|
|
{
|
|
|
var s = context.GetArgument<string>(0);
|
|
|
- buffer.Span[0] = Encoding.UTF8.GetByteCount(s);
|
|
|
+ buffer.Span[0] = s.Length;
|
|
|
return new(1);
|
|
|
}
|
|
|
}
|