Fix luajit / lua 5.1 incompatibility in common.utf8_chars

In lua 5.1, \x is not supported in string literals, and gmatch stops
parsing after a literal \0, so %z must be used instead.
This commit is contained in:
Jeremy Penner 2020-09-12 13:23:59 -04:00
parent 878c94a334
commit 655f7f61a9

View file

@ -8,7 +8,7 @@ end
function common.utf8_chars(text)
return text:gmatch("[\0-\x7f\xc2-\xf4][\x80-\xbf]*")
return text:gmatch("[%z\001-\127\194-\244][\128-\191]*")
end