When answering this question, I wrote this code to iterate over the UTF-8 byte sequence in a string:
local str = \"KORYTNAČKA\" for c in str:gmatch(\"[\\0-\\
See the Lua 5.1 manual on patterns.
A pattern cannot contain embedded zeros. Use %z instead.
In Lua 5.2, this was changed so that you could use \0 instead, but not so for 5.1. Simply add %z to the first set and change the first range to \1-\127.
\0
%z
\1-\127