mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 15:31:49 +00:00
fix utf8.sub behaviour
This commit is contained in:
parent
66796019af
commit
3147897709
1 changed files with 6 additions and 1 deletions
|
|
@ -57,7 +57,12 @@ static int l_sub(lua::State* L) {
|
||||||
if (lua::gettop(L) >= 3) {
|
if (lua::gettop(L) >= 3) {
|
||||||
end = std::max(0, static_cast<int>(lua::tointeger(L, 3) - 1));
|
end = std::max(0, static_cast<int>(lua::tointeger(L, 3) - 1));
|
||||||
}
|
}
|
||||||
return lua::pushstring(L, util::u32str2str_utf8(string.substr(start, end)));
|
return lua::pushstring(
|
||||||
|
L,
|
||||||
|
util::u32str2str_utf8(
|
||||||
|
string.substr(start, (end >= start ? end - start + 1 : 0))
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int l_upper(lua::State* L) {
|
static int l_upper(lua::State* L) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue