Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain
Andreas Jung wrote: > > > --On 22. Juli 2006 16:17:09 +0200 Tino Wildenhain <[EMAIL PROTECTED]> > wrote: >>> huh?..even on the file system a pt file is encoded using some encoding. >>> For an XML pagetemplate file the encoding is clearly defined through >>> the BOM (if available) and/or the XML p

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Andreas Jung
--On 22. Juli 2006 16:17:09 +0200 Tino Wildenhain <[EMAIL PROTECTED]> wrote: huh?..even on the file system a pt file is encoded using some encoding. For an XML pagetemplate file the encoding is clearly defined through the BOM (if available) and/or the XML preamble. So the most reliable solutio

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain
Andreas Jung schrieb: --On 22. Juli 2006 15:34:01 +0200 Tino Wildenhain <[EMAIL PROTECTED]> wrote: Well, pagetemplate files are another thing. They have to deal with the lack of charset information of a filesystem file and what they do once they load the data is even another thing. Even f

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Andreas Jung
--On 22. Juli 2006 15:34:01 +0200 Tino Wildenhain <[EMAIL PROTECTED]> wrote: Well, pagetemplate files are another thing. They have to deal with the lack of charset information of a filesystem file and what they do once they load the data is even another thing. Even filesystem pagetemplates sh

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Tino Wildenhain
Stefan H. Holek wrote: > On 21. Jul 2006, at 16:53, Chris Withers wrote: > >> I wonder how Zope 3's filesystem-based ZPT's deal with this? > > zope.pagetemplate.pagetemplatefile.PageTemplateFile reads an eventual > header, or defaults to UTF-8. Well, pagetemplate files are another thing. They

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-22 Thread Stefan H. Holek
zope.pagetemplate.pagetemplatefile.PageTemplateFile reads an eventual header, or defaults to UTF-8. Stefan On 21. Jul 2006, at 16:53, Chris Withers wrote: I wonder how Zope 3's filesystem-based ZPT's deal with this? -- Anything that, in happening, causes something else to happen, causes

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-21 Thread Chris Withers
Jens Vagelpohl wrote: CMFCore/FSPageTemplate does not do anything special, it defers to the PageTemplate implementation. Yay! *sigh* Uggg... we need something like python's header-at-top-of-file-to-specify-encoding thing, unless we force ZPT source to be XML, in which case we can "do the rig

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-21 Thread Chris Withers
Andreas Jung wrote: security.declareProtected(change_page_templates, 'PUT') def PUT(self, REQUEST, RESPONSE): """ Handle HTTP PUT requests """ self.dav__init(REQUEST, RESPONSE) self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1) ## XXX this should be unicode

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Tino Wildenhain
Andreas Jung wrote: > > > --On 17. Juli 2006 17:11:54 +0100 Chris Withers <[EMAIL PROTECTED]> > wrote: > >> Andreas Jung wrote: >>> >>> Zope 2.10 comes with the ZPT implementation of Zope 3 which works nicely >>> with unicode strings. However the 2.10 won't enforce the use of unicode >>> strings

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17 Jul 2006, at 12:24, Andreas Jung wrote: What about loading FS ZPT's and things like CMF's FSZPT? Ask Tres or Jens :-) CMFCore/FSPageTemplate does not do anything special, it defers to the PageTemplate implementation. jens -BEGIN

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Andreas Jung
--On 17. Juli 2006 17:11:54 +0100 Chris Withers <[EMAIL PROTECTED]> wrote: Andreas Jung wrote: Zope 2.10 comes with the ZPT implementation of Zope 3 which works nicely with unicode strings. However the 2.10 won't enforce the use of unicode strings for backward compatibility. However (at le

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Chris Withers
Andreas Jung wrote: Zope 2.10 comes with the ZPT implementation of Zope 3 which works nicely with unicode strings. However the 2.10 won't enforce the use of unicode strings for backward compatibility. However (at least) the ZopePageTemplate class constructor has a flag 'strict' to enforce t

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Chris Withers
Tino Wildenhain wrote: This would be my next question too regarding the management_page_charset cleanup I'm currently playing with. My vote would be to store unicode where possible - so you dont screw up everything when you change default_zpublisher_encoding in zope.conf. Yeah, unicode is good.

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Andreas Jung
--On 17. Juli 2006 16:55:42 +0100 Chris Withers <[EMAIL PROTECTED]> wrote: Andreas Jung wrote: I've had problems when it's an encoded string, but that seems to be what is stored when you save a ZPT via the ZMI or WebDAV... ZPT in pre-Zope 2.10 knows nothing about unicode...it can be any

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Tino Wildenhain
Chris Withers wrote: Andreas Jung wrote: I've had problems when it's an encoded string, but that seems to be what is stored when you save a ZPT via the ZMI or WebDAV... ZPT in pre-Zope 2.10 knows nothing about unicode...it can be anything :-) And what about 2.10? FWIW, this seems to be pr

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Chris Withers
Andreas Jung wrote: I've had problems when it's an encoded string, but that seems to be what is stored when you save a ZPT via the ZMI or WebDAV... ZPT in pre-Zope 2.10 knows nothing about unicode...it can be anything :-) And what about 2.10? FWIW, this seems to be problematic due to Zope

Re: [Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Andreas Jung
--On 17. Juli 2006 16:32:08 +0100 Chris Withers <[EMAIL PROTECTED]> wrote: The subject line says it all really ;-) I've had problems when it's an encoded string, but that seems to be what is stored when you save a ZPT via the ZMI or WebDAV... ZPT in pre-Zope 2.10 knows nothing about unic

[Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

2006-07-17 Thread Chris Withers
The subject line says it all really ;-) I've had problems when it's an encoded string, but that seems to be what is stored when you save a ZPT via the ZMI or WebDAV... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk _