0

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. . .

Doug Currie
  • 40,708
  • 1
  • 95
  • 119

3 Answers3

3

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.

lhf
  • 70,581
  • 9
  • 108
  • 149
1

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.

jpjacobs
  • 9,359
  • 36
  • 45
0

lua files are plain text, so if you're seeing garbage, it's not a lua file.

BMitch
  • 231,797
  • 42
  • 475
  • 450
  • I mean there are some coading in file and the file extention is .lua but wen i open it in to the Notepad it cant shows whole text. Some texts are shown and some are of garbage type text. . . then what should i do to read it ? –  May 03 '11 at 13:49
  • try a real programming editor such as PsPad on Windows, in addition to being a full featured editor you get syntax highlighting! – Adam May 04 '11 at 03:43