[Zope3-dev] Re: Bytes versus ASCII

Tres Seaver tseaver at palladion.com
Sat Jan 28 18:10:01 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?

'Bytes' should mean "arbitrarily-encoded string", where the application
is responsible for encoding / decoding the value.  Its primary use is to
store file uploads, AFAIK.


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD2/nJ+gerLs4ltQ4RAq+DAJ4vikEZD+bp2HT52N/Z3jppM11JcQCgmneD
OcyDSXHiZACZVqbHqUO8Ggc=
=ZYEv
-----END PGP SIGNATURE-----



More information about the Zope3-dev mailing list