[Zope-CMF] Unicode for ReST?
Charlie Clark
charlie.clark at clark-consulting.eu
Fri Apr 23 09:30:18 EDT 2010
Hi,
one thing that bothered me on a recent project was that even in a browser
view I have to decode "cooked_body" for those Satanic browsers Safari and
Internet Explorer.
I looked a bit into the system and saw that we still use ReST in a very
Wallace & Gromit way: ReST encodes the generated HTML using the default
encoding from zope.conf and we promptly decode it back to unicode every
time we want to display it, and make sure default-encoding and
rest-encoding match. Adding "output='unicode' to Document's CookedBody()
removes the double-encoding and doesn't break any tests. Would it be okay
to add this for Document and News objects and adjust the views
accordingly? I assume an upgrade step would need to run CookedBody() to
convert existing "cooked_text" to unicode.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
More information about the Zope-CMF
mailing list