[Zope] uploading text file by FTP: encoding problem?
egf05 at doc.ic.ac.uk
egf05 at doc.ic.ac.uk
Wed Aug 9 14:01:00 EDT 2006
Selon Dieter Maurer <dieter at handshake.de>:
> Eric Fernandez wrote at 2006-8-9 11:20 +0100:
> >I have a problem when I upload an ASCII text file into a zope2 folder. I
> >have a plain-text file with double quotes and line breaks. However, once
> >uploaded, double quotes become " and line breaks become \n. Even if
> >I change the property into text/plain or text/xml, I get the same problem.
>
> The default object type generated for "text/html", "text/xml" or
> "text/plain" is a "DTMLDocument" (and not a "File" object as you might
> except).
>
> The "__str__" method of "DTMLDocument" performs HTML escaping.
> That's why '"' may appear as """.
>
>
> You can install your own "PUT_factory" (search the mailing list archives
> for details) to control the type of object created during various
> types of uploads.
>
>
>
> --
> Dieter
>
Thanks a lot for the answer, that's exactly what I need. I found the topic in
the Zope book, development version.
Cheers,
Eric
More information about the Zope
mailing list