Re: [Zope3-dev] Bytes versus ASCII
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gary Poster schrieb am 27.01.2006 21:40: 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. But zcml needs two types: - - unicode for title and description parameters (what is not the case in the actual version) - - bytes elsewere. Egon ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/e.frerich%40nord-com.net - -- Egon Frerich, Freudenbergstr. 16, 28213 Bremen E-Mail: [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (MingW32) Comment: GnuPT 2.7.2 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD4xu6uTzybIiyjvURAgMyAKCm+ckWB89n7yl5Z6inFiElU4DN0gCgrgFE qyeQtVU6bqPCIqXMZBQ86vQ= =92ji -END PGP SIGNATURE- ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Bytes versus ASCII
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? Cheers, Christian -- gocept gmbh co. kg - forsterstraße 29 - 06112 halle/saale - germany www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 - fax +49 345 122 9889 1 - zope and plone consulting and development signature.asc Description: This is a digitally signed message part ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Bytes versus ASCII
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. ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com