Christoph Zwerschke
2009-03-12 13:05:49 UTC
FormEncode assumes 'utf-8' encoding for the UnicodeString validator.
This is usually ok, and you can even overwrite this using the
inputEncoding and outputEncoding settings. However, what you can *not*
do is have *no* input or output encoding at all, i.e. you can't use
Unicode in the "outside world", too. But this is necessary, for
instance, if you're using FormEncode with ToscaWidgets forms, because
most templating languages expect Unicode objects instead of encoded
strings. That's why ToscaWidgets comes with its own modified
UnicodeString validator. It would be nice to have this feature in
FormEncode already.
My suggestion is to allow setting inputEncoding and outputEncoding to
None. Currently, this will use the default encoding utf-8. I suggest not
decoding/encoding at all in this case, i.e. using unicode. If you don't
excplicity specify any inputEncoding or outputEncoding then, the default
utf-8 encoding will be used as before. I have already created a patch
for this feature. Can I check this in to the trunk?
-- Christoph
This is usually ok, and you can even overwrite this using the
inputEncoding and outputEncoding settings. However, what you can *not*
do is have *no* input or output encoding at all, i.e. you can't use
Unicode in the "outside world", too. But this is necessary, for
instance, if you're using FormEncode with ToscaWidgets forms, because
most templating languages expect Unicode objects instead of encoded
strings. That's why ToscaWidgets comes with its own modified
UnicodeString validator. It would be nice to have this feature in
FormEncode already.
My suggestion is to allow setting inputEncoding and outputEncoding to
None. Currently, this will use the default encoding utf-8. I suggest not
decoding/encoding at all in this case, i.e. using unicode. If you don't
excplicity specify any inputEncoding or outputEncoding then, the default
utf-8 encoding will be used as before. I have already created a patch
for this feature. Can I check this in to the trunk?
-- Christoph