diff options
Diffstat (limited to 'testes')
| -rw-r--r-- | testes/pm.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testes/pm.lua b/testes/pm.lua index 44454dff..f5889fcd 100644 --- a/testes/pm.lua +++ b/testes/pm.lua | |||
| @@ -56,7 +56,8 @@ assert(f(" \n\r*&\n\r xuxu \n\n", "%g%g%g+") == "xuxu") | |||
| 56 | 56 | ||
| 57 | -- Adapt a pattern to UTF-8 | 57 | -- Adapt a pattern to UTF-8 |
| 58 | local function PU (p) | 58 | local function PU (p) |
| 59 | -- break '?' into each individual byte of a character | 59 | -- distribute '?' into each individual byte of a character. |
| 60 | -- (For instance, "รก?" becomes "\195?\161?".) | ||
| 60 | p = string.gsub(p, "(" .. utf8.charpattern .. ")%?", function (c) | 61 | p = string.gsub(p, "(" .. utf8.charpattern .. ")%?", function (c) |
| 61 | return string.gsub(c, ".", "%0?") | 62 | return string.gsub(c, ".", "%0?") |
| 62 | end) | 63 | end) |
