Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...

by bart (Canon)
on Sep 17, 2002 at 04:05 UTC ( [id://198427]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...
in thread Handling Mac, Unix, Win/DOS newlines at readtime...

I remember reading somewhere in this thread that \r and \n have reversed semantics on the Mac (vs. *nix, Windows).

Um, no, that statement hasn't been made on this thread.

Oh yes it has. On a Mac, "\n" is "\015" (native end-of-lines), and "\r" is the other one, "\012". The sequences you can encounter, in Ascii, are matched by /\015\012|\015|\012/.

In addition, "\015\015\012" can occur too, in HTML pages you can download from the web, because of an erroneous FTP upload from Windows to Unix, as binary — and a download as text, which adds another CR.

  • Comment on Re: Re: Re: Re: Re: Handling Mac, Unix, Win/DOS newlines at readtime...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://198427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found