打开现成的Lua文件
我是 Lua 语言的新手。 。 。我有一些现成的 .lua 源文件。现在我想编辑它,也想修改它。首先,我想打开并查看它。
我在网上搜索过,发现它可以在记事本中打开,但是当我在记事本中打开它时,它显示一些垃圾值。 。 。 。
有人可以帮我打开它并阅读它吗?
提前致谢。 。 。
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. . .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果垃圾出现在文件的开头,它可能是一个字节顺序标记。在这种情况下,这是一个编辑器问题,而不是 Lua 问题。否则,也许你有一个预编译的Lua脚本?在这种情况下,请尝试 luac -l 。
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.好吧,Lua 字符串实际上可以包含二进制块,或者编辑器无法识别的编码块。这可能就是你所看到的。 (例如:http://codepad.org/jF4q4JHZ)
或者你传递了一个已编译的lua文件给定 .lua 扩展名,如 lhf 建议的那样。
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 文件是纯文本,因此如果您看到垃圾,则它不是 lua 文件。
lua files are plain text, so if you're seeing garbage, it's not a lua file.