I am new to the Lua language. . . I have some ready made .lua source files. Now I want to edit it and also want to modify it. First, I want to open and see it.
I have searched on net, and found that it may be opened in Notepad, but when I open it in Notepad it shows some garbage value. . . .
Can anybody help me to 开发者_运维知识库open it and read it?
Thanks in advance. . .
If the garbage appears at the beginning of the file, it's probably a byte order mark . In this case it's an editor problem, not a Lua problem. Otherwise, perhaps you have a precompiled Lua script? In this case, try luac -l
on it.
Well, Lua strings can actually contain binary chunks, or chunks in an encoding not recognized by your editor. That may be what you're seeing. (for example: http://codepad.org/jF4q4JHZ)
Or you got passed a compiled lua file which has been given a .lua extension, as lhf suggested.
lua files are plain text, so if you're seeing garbage, it's not a lua file.
精彩评论