mirror of
https://github.com/lua/lua.git
synced 2026-09-14 06:18:10 +00:00
Towards release 5.4.7
This commit is contained in:
@@ -56,7 +56,8 @@ assert(f(" \n\r*&\n\r xuxu \n\n", "%g%g%g+") == "xuxu")
|
||||
|
||||
-- Adapt a pattern to UTF-8
|
||||
local function PU (p)
|
||||
-- break '?' into each individual byte of a character
|
||||
-- reapply '?' into each individual byte of a character.
|
||||
-- (For instance, "á?" becomes "\195?\161?".)
|
||||
p = string.gsub(p, "(" .. utf8.charpattern .. ")%?", function (c)
|
||||
return string.gsub(c, ".", "%0?")
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user