- strlen handles utf8 strings correctly

This commit is contained in:
2022-10-26 16:28:18 +02:00
parent 0bad4520d8
commit 5ebd02ae66

View File

@@ -564,7 +564,7 @@ extern "C" {
} }
static int cpp_strlen(lua_State *L) { static int cpp_strlen(lua_State *L) {
const char* str = luaL_checkstring(L, 1); const char* str = luaL_checkstring(L, 1);
lua_pushinteger(L, strlen(str)); lua_pushinteger(L, utfstrlen(str));
return 1; return 1;
} }