UnicodeString encoding

Christoph Zwerschke <[email protected]> Thu, 12 Mar 2009 14:05:49 +0100
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
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

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com