[Zope3-dev] Bytes versus ASCII

Gary Poster gary at zope.com
Fri Jan 27 15:40:28 EST 2006


On Jan 27, 2006, at 5:16 AM, Christian Theune wrote:

> Hi,
>
> (this is about zope.schema)
>
> I assumed that the fields Bytes and ASCII have some distinction. The
> ASCII field explicitly checks for every character to have an ordinal
> value lower than 127.
>
> Bytes however does a cast in fromUnicode(u) that does str(u). This  
> will
> break if there are non-ascii characters in the unicode string.
> Effectively this makes it an ASCII field as well.
>
> However, I don't know enough about the environment, so eventually this
> is all good. When does the fromUnicode method get called? Everytime I
> use this field through zope.app.form or zope.formlib?

I think it might be leveraged elsewhere, but the big client AFAIK is  
zcml.


More information about the Zope3-dev mailing list