[Zope-dev] [ZOPE 2.6 B1] Unicode/locale problems with OFS/dtml/properties.dtml

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 26 Sep 2002 19:01:02 +0100


On Thursday 26 Sep 2002 5:47 pm, Arnar Lundesgaard wrote:

Thanks for taking the time to help debug this.

> > > lib/python/OFS/dtml/properties.dtml contains ...
> > >    <dtml-var "u''">

> > This ensures that the dtml which computes this page
> > content returns a unicode object.

This line, intended to force the dtml to be rendered as a unicode object,=
 is=20
not doing its job. If the dtml is not a unicode object then ZPublisher's=20
encoding mechanism is not engaged. Has there been some recent dtml=20
optimisation to ignore empty strings perhaps?

This patch below works for me. Please let me know if this works for you a=
nd I=20
will apply it to 2.6. (and various sources of documentation that all=20
recommend including this line.)


Index: properties.dtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs-repository/Zope/lib/python/OFS/dtml/properties.dtml,v
retrieving revision 1.8
diff -c -2 -r1.8 properties.dtml
*** properties.dtml     7 May 2002 17:54:56 -0000       1.8
--- properties.dtml     26 Sep 2002 17:54:48 -0000
***************
*** 1,4 ****
  <dtml-call "REQUEST.set('management_page_charset','UTF-8')">
! <dtml-var "u''">
  <dtml-var manage_page_header>
  <dtml-with "_(management_view=3D'Properties')">
--- 1,4 ----
  <dtml-call "REQUEST.set('management_page_charset','UTF-8')">
! <dtml-var "u' '">
  <dtml-var manage_page_header>
  <dtml-with "_(management_view=3D'Properties')">