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:
parent
878c94a334
commit
655f7f61a9
|
@ -8,7 +8,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function common.utf8_chars(text)
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue