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

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 9 Sep 2002 15:42:49 +0100


On Monday 09 Sep 2002 3:22 pm, Florent Guillaume wrote:

> The problem is that the default charset
> has to depend on a number of factors,=20

> especially the "native" charset
> for the DocumentTemplate or PageTemplate being acted upon,=20

That seems useful for encoding output, but not decoding input surely?

> and the
> "native" charset for strings generated by python code.

Yes, although new python code should be creating Unicode strings IMO.

Most legacy code in Zope would have to deal with the fact that, sooner or=
=20
later, its strings get embedded into 'text/html' pages with no charset=20
declaration. This means latin-1 in practice.

> I don't know at
> what level this should be configured.

IMO, at the level in which encoded strings are read from byte-streams, an=
d=20
converted into Unicode at the earliest opportunity. General purpose=20
text-processing tools like dtml and zpt should not have to deal with=20
character encodings.