[I18n-sig] XML and codecs

M.-A. Lemburg mal@lemburg.com
Thu, 07 Jun 2001 23:04:23 +0200


Walter Doerwald wrote:
> 
> On 07.06.01 at 11:53 Walter Doerwald wrote:
> 
> > On 06.06.01 at 17:57 M.-A. Lemburg wrote:
> >
> > > [...]
> > > > Do we want error handling callbacks?
> > >
> > > I think we should still keep them on the TODO list.
> >
> > OK! Then I'll start playing around with it.
> 
> I started working on this, and it's progressing nicely.

Cool :)

> It's already possible to do things like:
> 
> >>> import codecs
> >>> codecs.ascii_encode(
> ...     u"auo",
> ...     lambda enc, uni, pos: u"&#x%x;" % ord(uni[pos]))
> ('aäuüoöß', 7)
> >>> import unicodedata
> >>> codecs.latin_1_encode(
> ...     u"a\u3042b",
> ...     lambda enc, uni, pos: u"<%s>" % unicodedata.name(uni[pos]))
> ('a<HIRAGANA LETTER A>b', 3)
> 
> String arguments are still accepted:
> >>> codecs.ascii_encode(u"auo", "ignore")
> ('auo', 7)
> 
> Bye,
>    Walter Drwald
> 
> --
> Walter Drwald  LivingLogic AG  Bayreuth, Germany  www.livinglogic.de
> 
> _______________________________________________
> I18n-sig mailing list
> I18n-sig@python.org
> http://mail.python.org/mailman/listinfo/i18n-sig

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/