lua-users home
lua-l archive

Re: binary string modified

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2016年08月23日 7:36 GMT+02:00 Satoru Kawahara <s1311350@coins.tsukuba.ac.jp>:
>> On 16-08-20 05:41 PM, nobody wrote:
>> > On 2016年08月20日 23:09, Satoru Kawahara wrote:
>> >> Hello,
>> >>
>> >> I tried to copy luac.out into a script file as string and run the
>> >> native
>> >> code string with `load()`.
...
> BTW, why does the binary modification occur?
RTFM.
"Lua opens files for parsing in text mode", i.e. line by line.
"Any kind of end-of-line sequence (carriage return, newline, carriage
return followed by newline, or newline followed by carriage return)
is converted to a simple newline."
Advantage: you can read WIndows Lua code in Linux and vice versa.
"So, it is safer to represent non-text data as a quoted literal with explicit
escape sequences for non-text characters. "

AltStyle によって変換されたページ (->オリジナル) /