[Zope3-dev] Re: CRLF in text from forms

Jim Fulton jim@zope.com
Thu, 22 May 2003 18:54:56 -0400


Guido van Rossum wrote:
> I noticed that multi-line text entered in schema-generated forms
> contains CRLF as line delimiters.  At least, when I create a document
> containing text (e.g. a file or a dtml page) using a form, and then
> use fssync to dump it to the filesystem, I have something with CRLF
> delimiters.  I think that's wrong, and the form machinery should
> replace CRLF with LF.  That's as simple as
> 
>   t = t.replace("\r\n", "\n")
> 
> but I wouldn't know where to put it, so I'm hoping that someone else
> can fix this.
> 
> (Why is it IMO wrong to have CRLF delimiters?  Because the data we're
> storing is processed by Python text processing code, and Python always
> assumes LF delimiters for text.  And we know damn well that it's text,
> because it came from a TEXT widget. :-)

I agree. I fixed this.

Jim


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org