[Zope3-dev] Bytes versus ASCII

Christian Theune ct at gocept.com
Fri Jan 27 15:51:37 EST 2006


On Fri, 2006-01-27 at 15:40 -0500, Gary Poster wrote:
> > 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.

So. Hmm. It looks like there is no better way to do that eventually,
because the mapping from unicode space to some 8-bit space is pretty
ambigous. I wonder whether this should be stated somewhere around there
quite cleary, that you can only put in unicode into a bytes field when
it maps to ASCII.

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20060127/e42c127d/attachment.bin


More information about the Zope3-dev mailing list