Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
--On 5. Januar 2007 21:22:24 +0100 Jens Vagelpohl [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5 Jan 2007, at 20:51, Andreas Jung wrote: I finished my work (including some test). Any objections merging the changes back to the trunk? If the tests pass, no. At least from me ;) I merged the changes... hopefully without side-effects :-) Andreas pgp0VBlVpAIZs.pgp Description: PGP signature ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6 Jan 2007, at 12:57, Andreas Jung wrote: On 5 Jan 2007, at 20:51, Andreas Jung wrote: I finished my work (including some test). Any objections merging the changes back to the trunk? If the tests pass, no. At least from me ;) I merged the changes... hopefully without side-effects :-) Now is the best time, I'm sure Plone 3 testing will give it the best workout it can get. I hope to finish my huge checkin (deprecating getToolByName and replacing it with utility calls) this weekend. jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFn49VRAx5nvEhZLIRAg1FAJ40sF1m+kXHDB4tlKpeaNpVDTHhtACbB/Pb qSFZBtGB3AWW0931Y3fMVa8= =f/s/ -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 20. Dezember 2006 19:34:22 +0100 Andreas Jung [EMAIL PROTECTED] wrote: If you look at the current FSPageTemplate code, there was already an attempt to find and transfer enoding information with the response by way of adding it to the content type, see _readFile. It does preamble sniffing as well. That could then be replaced by your own encoding detection, which also uses the preamble, and .metadata information. I created an experimental branch and added some more (hopefully) clever sniffing (which I added recently for the ZPT fixes on the HEAD). I finished my work (including some test). Any objections merging the changes back to the trunk? Andreas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (Darwin) iD8DBQFFnqwrCJIWIbr9KYwRAlCBAKCrgTJrgRM9A/QMlIeO6tURh1wRqwCgu450 R9uKzf+giagAh3cP6YKM7dk= =gt3u -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5 Jan 2007, at 20:51, Andreas Jung wrote: I finished my work (including some test). Any objections merging the changes back to the trunk? If the tests pass, no. At least from me ;) jens -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFnrOARAx5nvEhZLIRAohkAKCEQ1mbWZbSrKEjcK+r4XRE129fLwCfax7J G3gxcZzBB997oZRd7y3yVmE= =/Y5T -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 19. Dezember 2006 09:58:37 +0100 Jens Vagelpohl [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19 Dec 2006, at 09:45, Andreas Jung wrote: Jup. However I am not completely sure about all impacts :-) If I understand the description correctly, the real change is in how the surrogate page template object representing the filesystem page template is created. The rendering itself is handed off to the pt_render method from the original PageTemplate class. Right. The pt_render() should return unicode only. Let's assume FSPageTemplates would use unicode internally and a customized copy (an instance of ZopePageTemplate) wouldn't then we would definitely run into UnicodeDecode errors. That's why we should use unicode as internal representation where possibly. However applications will likely run into UnicodeDecode error for example with scripts returning non-unicode... If you look at the current FSPageTemplate code, there was already an attempt to find and transfer enoding information with the response by way of adding it to the content type, see _readFile. It does preamble sniffing as well. That could then be replaced by your own encoding detection, which also uses the preamble, and .metadata information. I created an experimental branch and added some more (hopefully) clever sniffing (which I added recently for the ZPT fixes on the HEAD). Andreas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (Darwin) iD8DBQFFiYIvCJIWIbr9KYwRAoOGAJ4iOqjJkJokXW5W5O1bJJTDCeGkWwCgoBWQ bgkZc8ETfb+49kepMJ1DNuc= =ZWTb -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On 19. Dezember 2006 09:34:13 +0100 Jens Vagelpohl [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18 Dec 2006, at 13:52, Andreas Jung wrote: What has to be done: - FSPageTemplate._readFile() should convert 'data' to unicode and pass it to pt_edit() instead of using write() - a filesystem-based PT should be able to specify its encoding through the .metafile like [default] encoding=utf-8 For XML files the encoding is determines by the XML preamble and for HTML file we are able to check for the 'charset' inside meta http-equiv=content-type ... tag (if available) What do you think about this idea? Are you saying you'd help with patches? I'm swamped right now and don't think I can look at it. Jup. However I am not completely sure about all impacts :-) Andreas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (Darwin) iD8DBQFFh6aXCJIWIbr9KYwRAn8bAKDIQ5sUw8j7IbQMV7JRZeiXAdHGRQCfUr8K /ARKDtZHRtdywPqBBo7qFlU= =fjpK -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] [CMF 2.1] FSPageTemplate Unicode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 You might have noticed that I have changed the ZopeTemplateFile implementation to work with unicode as internal representation. I think it would make sense for FSPageTemplate instance to use unicode as well - especially when ZPTs and FSPageTemplate live side by side. However FSPageTemplate inherits directly from PageTemplate. What has to be done: - FSPageTemplate._readFile() should convert 'data' to unicode and pass it to pt_edit() instead of using write() - a filesystem-based PT should be able to specify its encoding through the .metafile like [default] encoding=utf-8 For XML files the encoding is determines by the XML preamble and for HTML file we are able to check for the 'charset' inside meta http-equiv=content-type ... tag (if available) What do you think about this idea? How about the schedule? I would like to port my ZPT changes to the Zope 2.10 branch because the ZPT implementation is now partly broken and needs the fixes. However I don't know if the changes will play nicely with the upcoming CMF 2.1 release. I had no problem with a plain CMF site running on Zope 2.10.2 with my changes but we should ensure that are not big issues with the upcoming Plone 3.0 release (which requires Zope 2.10/CMF 2.1). Andreas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (Darwin) iD8DBQFFho8GCJIWIbr9KYwRAt9GAJwLS+t3vz95JUTDiB498+3YVLCCtACeNv1q aCFwpGMUg8VjlXJLXpqCKFw= =D/F6 -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests