[Zope-CMF] Re: [dev] using unicode in CMF 2.0 - a proposal

Tres Seaver tseaver at palladion.com
Mon Jan 30 10:39:27 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

yuppie wrote:

> A major goal of CMF 2.0 is to make it easier to use Zope3/Five features
> in CMF. One issue that is not resolved so far is the fact that the CMF
> uses encoded strings while Zope3/Five uses unicode strings. That calls
> for trouble, especially in page templates because they can't handle
> non-ascii encoded strings mixed with unicode.
> 
> One source of unicode strings are Message objects and translations. Both
> Localizer and Placeless Translation Service monkey patch page templates
> to work around the unicode problem. All unicode strings are encoded with
> the page encoding before joining them with other strings. This seems to
> work quite well, but it's nasty because of the monkey patching.
> 
> 
> Proposal:
> 
> 1.) All skin templates that have to deal with non-ascii content don't
> access the content objects directly. As it is already the case for most
> forms they should get their content from a skin script instead.
> 
> 2.) The return value of all those scripts is converted using
> CMFDefault.utils.toUnicode and the 'default_charset' of the site.
> 
> 
> This is a sledgehammer method and customized skins have to be changed in
> the same way. But after that we should be out of the woods:
> 
> - We can start to convert step by step other parts of the CMF to unicode
> and to use Zope3/Five components that return unicode.
> 
> - We should be prepared for the upcoming page template changes.
> 
> 
> I know this has drawbacks, but I don't see a better solution. If there
> are no objections I'd like to work on this before the CMF 2.0 beta.

+1.  Jens and I were talking about the beta release at dinner Saturday,
and finding some practical solution to this issue was the major
roadblock.  I intend to work this week on creating equivalent five views
for as many of the CMF skins as possible, starting with the
"content-specific" ones, and will try to emulate what you do in the skin
side.  I will also be working on setting up the "non-customizable"
profile as a way for people to play with the "Five-only" setup.


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD3jMv+gerLs4ltQ4RAn5vAJ4zFMxSd2iljO2B7T4JeROEVB7TiQCdEycU
szvZx27yOeytflA8UISWurg=
=wxJe
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list