- strlen handles utf8 strings correctly
This commit is contained in:
2
lua.cpp
2
lua.cpp
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user