[Python-Dev] XML codec?

M.-A. Lemburg mal at egenix.com
Sun Nov 11 12:34:41 CET 2007


On 2007-11-10 09:54, Martin v. Löwis wrote:
>> A non-seekable stream is not all that uncommon in network processing.
> 
> Right. But what is the relationship to XML encoding autodetection?

It pops up whenever you need to detect the encoding of the
incoming XML data on the network connection, e.g. in XML RPC
or data upload mechanisms.

Even though XML data mostly uses UTF-8 in real life applications,
a standards compliant XML interface must also support other
possible encodings.

It is also not always feasible to load all data into memory, so
some form of buffering must be used.

Since incremental codecs already implement buffering, it's only
natural to let them take care of the auto detection.

This approach is also needed if you want to stack stream codecs
(not sure whether this is still possible in Py3, but that's how
I designed them for Py2).

Regards,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 11 2007)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611


More information about the Python-Dev mailing list