mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-06-22 20:24:36 +02:00
19 lines
349 B
Lua
19 lines
349 B
Lua
|
|
local fp = assert(io.open(arg[1], "rb"))
|
|
local str = assert(fp:read("*a"))
|
|
fp:close()
|
|
|
|
local i
|
|
local c = 0
|
|
local ostr = "local xxxxx = \""
|
|
for i = 1, string.len(str) do
|
|
ostr = ostr .. "\\" .. string.byte(string.sub(str, i, i+1))
|
|
if string.len(ostr) > 74 then
|
|
io.write(ostr .. "\"\n")
|
|
ostr = ".. \""
|
|
end
|
|
end
|
|
io.write(ostr .. "\"\n")
|
|
|
|
|