mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-09-30 23:11:16 +02:00
*** empty log message ***
git-svn-id: file:///var/svn/lua-iconv/trunk@18 9538949d-8f27-0410-946f-ce01ef448559
This commit is contained in:
18
makestr.lua
Normal file
18
makestr.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
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")
|
||||
|
||||
|
Reference in New Issue
Block a user