lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 11 Nov 2009, Tony Finch wrote:
>
> local function char(c) return ("\\%3d"):format(c:byte()) end
> local function szstr(s) return ('"%s"'):format(s:gsub("[^ !#-~]", char)) end

Oops, that should be "\\%03d"

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.