Allow specifying offset for `common.is_utf8_cont`

This commit is contained in:
Guldoman 2021-10-11 22:18:02 +02:00
parent 8b634daa66
commit 3a71528087
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 2 additions and 2 deletions

View File

@ -1,8 +1,8 @@
local common = {}
function common.is_utf8_cont(char)
local byte = char:byte()
function common.is_utf8_cont(s, offset)
local byte = s:byte(offset or 1)
return byte >= 0x80 and byte < 0xc0
end