in reply to Re^2: Trouble with newlines
in thread Trouble with newlines

The line endings are extremely annoying if one is on a dual boot box (Win/*nix) and trys to tweak CGI supposed to run on Apache/*nix as well as on IIS/Win.

Whenever one writes textmode *\n* to a file on booted Win and later boots the other OS reading the same file on *nix it ends up to be \r\n.
Extremely annoying imho. Sometimes one forgets about it and then wonders why things don't work as expected .

Replies are listed 'Best First'.
Re^4: Trouble with newlines
by naikonta (Curate) on May 12, 2007 at 16:56 UTC
    Well, you're not alone :-). Here, comments from inside Lincoln Stein's CGI.
    # Define the CRLF sequence. I can't use a simple "\r\n" because the m +eaning # of "\n" is different on different OS's (sometimes it generates CRLF, + sometimes LF # and sometimes CR). The most popular VMS web server # doesn't accept CRLF -- instead it wants a LR. EBCDIC machines don't # use ASCII, so \015\012 means something different. I find this all # really annoying.

    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!