Re: string

Michael Watkins <[email protected]>
Newsgroups gmane.comp.web.quixote.user,gmane.comp.python.durus
Message-ID <[email protected]>
* David Binger wrote [2005-10-13 17:34:20 -0400]:

> 
> On Oct 13, 2005, at 5:00 PM, Michael Watkins wrote:
> >
> >string = either(str, unicode)
 
> This reminds me that I should preview upcoming changes related
> to spec and unicode.  I think we'll get a new release out next
> Tuesday evening.

I'm glad to hear that - cc'ing this to the Quixote list for Dulcinea fans
there who don't read the Durus list.

> We've put into the DulcineaPublisher constructor a statement
> that changes the quixote DEFAULT_CHARSET to 'utf8', so values
> we get from forms will be unicode.  You can't combine unicode
> with non-ascii str instances easily:  the automatic decoding
> can't work in that case.
> 
> So, we've added to a new SpecOperator named "string" to the spec
> module.  A "string" can be either a unicode or else an ascii str.
> The important feature of these strings is that they can be combined
> without risk of UnicodeEncodeErrors.  We changed every "str" attribute
> specification to "string" and ran an update script to convert all
> str attribute values to unicode, trying to guess the right charset for
> each instance (not always easy).
> 
> We also had to change some str() calls to quixote's stringify(),
> and there certain % operations need to be modified, but this
> conversion appears to be working as planned.

I'm not surprised to learn that your conversion wasn't instant but am glad to
see we'll all benefit from the effort.

I keep running into little unicode 'got-yahs' elsewhere but it does feel like
the whole ship is slowly moving there.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.