- strlen handles utf8 strings correctly
This commit is contained in:
1 parent
0bad4520d8
commit
5ebd02ae66
1 file changed
+1
-1
@@ -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