[Zope-Coders] Re: [Zope-Checkins] CVS: Zope27/lib/python/TAL - TALInterpreter.py:1.68.26.2

Florent Guillaume fg@nuxeo.com
09 Sep 2002 16:22:33 +0200


[moving to zope-coders too, please tell me if you don't want
to be on Cc]

On Mon, 2002-09-09 at 15:28, Toby Dickenson wrote:
> On Monday 09 Sep 2002 2:03 pm, Florent Guillaume wrote:
> > I completely agree that this is not a panacea, and that it would be much
> > better to put the correct StringIO in Zope and be done with it, but a
> > completely corrected Unicode-aware StringIO is something I don't have
> > and which is, from what I gather, not trivial. Guido probably has more
> > info on that.
> 
> There is some trickyness here, but a solution has been agreed for DTML. See  
> DocumentTemplate.DT_Util.join_unicode for a string.join substitute that does 
> the right thing with mixed unicode and non-unicode strings.  Rolling that 
> into a ZPT-friendly StringIO shouldnt be hard.
> 
> 
> This was originally on the Zope 2.6 roadmap: 
> http://lists.zope.org/pipermail/zpt/2002-April/003256.html

Yep, I know about join_unicode.

It probably should be moved out of DT_Util and to a more fundamental
level (but there's a C version too...), as PT wants to use it too
eventually.

But currently it defaults to latin-1 for unknown charsets, which is not
acceptable to lots of people. The problem is that the default charset
has to depend on a number of factors, especially the "native" charset
for the DocumentTemplate or PageTemplate being acted upon, and the
"native" charset for strings generated by python code. I don't know at
what level this should be configured.

Florent
 
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com