On Tuesday 22 April 2008, Charlie Reitzel wrote:
> Sounds like a job for a filter/sub-routine that simply sets the perl line
> separator variable for your application.  Put another way, it should be
> fairly simple to separate the business logic from the desired output line
> ending.
>
> Btw, Macs use a plain CR as the line ending for text files.
>

As far as I know, that's the case only for Mac OS 9 and below - i.e: the Macs 
before Mac OS X. Mac OS X has converted to LF, similar to most other UNIXes 
(Linux, the BSDs, Solaris, etc.). 

> Of course, the HTTP response headers use CR+LF on any/all platforms.
>

Yes, but not the content.

More information:

1. http://www.onlamp.com/pub/a/onlamp/2006/08/17/understanding-newlines.html

2. http://en.wikipedia.org/wiki/Newline

Regards,

        Shlomi Fish

> At 09:54 AM 4/22/2008 -0400, Jun Wan wrote:
> >Hi,
> >
> >I am developing a web app, where the server needs to generate text
> > document and send back to browser and other client. Windows users often
> > open it in notepad, so I want it formatted properly there. However, the
> > line break is different on Windows (\r\n) and Unix (\n), I can of course
> > detect the client type and generate the text document accordingly, but
> > this is rather difficult due to our specific business logic and also we
> > want to keep the text generation logic rather simple. I am wondering if
> > there are other ways around this, for example, to set the mime type to
> > application/rtf so that wordpad is used to open the doc in windows.
> >Any other ideas?
> >
> >Jun
> >
> >----
> >Jun Wan
> >GenomeQuest, Inc.
> >
> >_______________________________________________
> >Boston-pm mailing list
> >Boston-pm@mail.pm.org
> >http://mail.pm.org/mailman/listinfo/boston-pm
>
> _______________________________________________
> Boston-pm mailing list
> Boston-pm@mail.pm.org
> http://mail.pm.org/mailman/listinfo/boston-pm

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Understand what Open Source is - http://xrl.us/bjn82

The bad thing about hardware is that it sometimes work and sometimes doesn't.
The good thing about software is that it's consistent: it always does not
work, and it always does not work in exactly the same way.
 
_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to