[z3-five] Extended characters in forms

Martijn Faassen faassen at infrae.com
Fri May 13 16:37:31 CEST 2005


Lennart Regebro wrote:
> This does not work. If you have a character like ä in a form, the
> widgets try to do unicode(input) on it and you get a
> UnicodeDecodeError, 'ascii' codec can't decode byte 0xe5 in position
> 0: ordinal not in range(128).
> 
> How to fix?

I'm surprised at this. Just unicode(input) is never going to work and in 
that case it doesn't work in plain Zope 3 either, which would be a surprise.

What I'd expect is that something in Zope 3 (the publisher?) converts 
(likely UTF-8) input to unicode; I'm not sure why the widget is doing 
another unicode().

What needs to be done in our case, I guess, is a unicode(input, 
ask_zope_for_default_encoding_in_this_context())

What is happening on output?

Regards,

Martijn



More information about the z3-five mailing list