Re: encoding solutions.
Stuart Bishop <zen-Tnwq/[email protected]> Wed, 24 Sep 2003 22:33:07 +1000
| Newsgroups | gmane.comp.web.zope.formulator.devel |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I'm considering moving towards a Formulator 2.0 anyway at some point, > which means we might accept at least the upgrade issue and a bit of > code breakage. There's also a usability issue though; if you use *any* latin-1 > encoding in your page template use Formulator you'd get unicode errors if I > made title and description store their data as unicode... > Suggestions? One point is that it will be a pain to support development of a Formulator that uses Unicode strings for both Zope 2.5- and Zope 2.6+. Another point is that while Page Templates handle Unicode strings, DTML pages don't. I think the sanest way to do Unicode properly in Zope at the moment is to drop support for Zope 2.5 and DTML, but I'm sure not everyone has that luxury :-) It may be possible to make TAL.TALInterpreter.FasterStringIO handle mixing Unicode string and traditional strings sanely. It would involve replacing the inherited getvalue() method with one that catches the ASCII encoding exceptions, converting these strings to Unicode strings (by checking the RESPONSE headers for the expected character encoding, or using a heuristic method to guess if you're feeling brave). I haven't tried this yet, and fixing DTML is left as an exercise to the reader :-) - -- Stuart Bishop <zen-Tnwq/[email protected]> http://shangri-la.dropbear.id.au/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (Darwin) iD8DBQE/cY8Ih8iUz1x5geARArjOAKD8nmQ1Pz5JxAFEcW9k5BArSXvg1ACgkChu X2KTCyKWfHMz1DDeW7N3h+8= =ObZv -----END PGP SIGNATURE-----