Re: UnicodeString encoding

Ian Bicking <[email protected]> Thu, 12 Mar 2009 12:11:38 -0500
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
On Thu, Mar 12, 2009 at 12:07 PM, Christoph Zwerschke <[email protected]> wrote:
> Ian Bicking schrieb:
>  > Changing the default behavior could mess up working code.  I think it
>  > would make sense to treat an encoding of None as do-not-encode (or
>  > decode).  A subclass of UnicodeString could have that value
>  > (outputEncoding) default to None.
>
> Yes, that's exactly what my patch does: It uses NoDefault instead of
> None as the default value for inputEncoding and outputEncoding, treats
> None as "do no encode/decode" and falls back to the encoding set at the
> class level (utf-8 for the standard class) if nothing is specified.
>
> I've checked this in as r3805 now. Maybe we also want to add input and
> output encoding default attributes on the class level? There is
> currently only one common attribute for both. If we agree on the new
> behaviour, I will also update the docstring and unit tests.

Ah, I see there's just the one encoding.  Yeah, lets add specific
ones, with NoDefault settings so that they default to the value of
encoding (in __init__).

-- 
Ian Bicking  |  http://blog.ianbicking.org

------------------------------------------------------------------------------
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
_______________________________________________
FormEncode-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-discuss