[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: strange question about the io.write
- From: bidong liao <liaoliaopro@...>
- Date: Fri, 20 Nov 2009 08:33:34 +0800
got it. thanks for your elaborations. will remember this pratical "bottom line",
Bottom line: open files in text mode (the default) and output only \n,
never \r. If you want to generate a specific byte sequence, then you need
to open the file in binary mode for writing.
On Thu, Nov 19, 2009 at 9:36 PM, Philippe Lhoste <PhiLho@gmx.net>
To be exact, pre-OS X Macs use CR only. AFAIK, MacOS X uses LF like all Unix systems.
On 19/11/2009 11:08, Kenneth Forsbäck wrote:
Different platforms use different definitions for new line.
unix/linux = LF
windows = CRLF
mac = CR
Because on systems with LF as line ending, CR is kept as is, LF is converted to system's line ending, ie. LF...
bidong liao wrote:
but why? different platforms got different results(mac got CRLF but windows