[Product-Developers] z3c.form - unicode problem

Umberto Calligaro u.calligaro at tecnoteca.com
Wed Mar 28 15:10:36 UTC 2012


I've a problem with unicode and z3c.form.
This is my scenario: I've a custom contet type (CT) based on Archetypes.
I've made a z3c.form Form to let anonymous users edit data and the form
fields are generated from the interface of the CT.
When I call the form with "ignoreContext=False" if there's a special
character (something like "è","à", etc. ) in the description field, I get
this error:

2012-03-28T16:00:31 ERROR Zope.SiteErrorLog 1332943231.380.770318914895
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module plone.z3cform.layout, line 70, in __call__
  Module plone.z3cform.layout, line 54, in update
  Module tecnoteca.associations.forms.add_update_event, line 36, in update
  Module z3c.form.form, line 208, in update
  Module plone.z3cform.patch, line 21, in BaseForm_update
  Module z3c.form.form, line 149, in update
  Module tecnoteca.associations.forms.add_update_event, line 43, in
  Module z3c.form.form, line 134, in updateWidgets
  Module z3c.form.field, line 275, in update
  Module z3c.form.browser.textarea, line 36, in update
  Module z3c.form.browser.widget, line 70, in update
  Module z3c.form.widget, line 123, in update
  Module z3c.form.converter, line 43, in toWidgetValue
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 21:
ordinal not in range(128)

How can I fix this problem?

Umberto Calligaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120328/ddc83f55/attachment.html>

More information about the Product-Developers mailing list