[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: binary string modified
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 23 Aug 2016 09:34:09 +0200
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. "