I'll take a stab, but I could be wrong..... I believe the line breaks are supposed to get converted on the fly, so while the line breaks are just LF in *nix, the browser in windows converts them to CR LF.
Though you might have to set the header to Content-type: text/plain as hint if you target audience is opening it directly to notepad as I'm not sure if the conversion would take place in that case. Where line break badness happens is when you FTP a windows text file up to a *nix server from windows in binary mode, because then you have windows formatted line endings (CR LF) on a *nix server that should only have LF; so when a windows client browser subsequently downloads it, the conversion makes all the line endings CR CR LF, which is not what you want. Matthew 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 > [email protected] > http://mail.pm.org/mailman/listinfo/boston-pm > -- 43 - for those who require slightly more than the answer to life, the universe and everything _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

