[Zope3-dev] Existential question about BytesWidget v.s. ASCIIWidget

Stéphane Brunet stbru at teksavvy.com
Sun Jun 12 20:20:36 EDT 2005


Hi,

I am presently working on a bugfix for issue 302 (I hope that's ok). 
However an existential question arose when dealing with Bytes field and 
UTF-8 encoding...

Quoting the Zope3 dev. book 
(http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/schema.html) 
:
--- start of quote ---

    * BytesWidget, BytesAreaWidget: Direct descendents from TextWidget
      and TextAreaWidget, the only difference is that these widgets
      expect bytes as input and not a unicode string, which means they
      must be valid ASCII encodable.
    * ASCIIWidget: This widget, based on the BytesWidget, ensures that
      only ASCII character are part of the inputted data.

--- end of quote ---

Moreover, looking at the source code 
(src\zope\app\form\browser\textwidgets.py) proves that the class 
definition of ASCIIWidget is just an "alias" of BytesWidget.

What is the "raison d'être" of ASCIIWidget v.s. BytesWidget if they 
expect the same type of input (plain ASCII text) and store it the same 
type of fields?

This seems a bit confusing for me...

Regards,

Stéphane



More information about the Zope3-dev mailing list