[ANN] pyxser-1.2r --- Python-Object to XML serialization module

Stefan Behnel stefan_ml at behnel.de
Tue Aug 25 07:23:18 CEST 2009

Stefan Behnel wrote:
> for all byte
> strings, regardless of their encoding (since you can't even know if they
> represent encoded text at all).

Hmm, having written that, I guess it's actually best to encode byte strings
as base64 instead. Otherwise, null bytes and other special byte values
won't pass.

I also think that if the user wants readable output for text strings, it's
reasonable to require Unicode input instead of byte strings. Handling text
in byte strings is just too error prone.

Still, you may have to sanitize text input to make sure it doesn't contain
special characters either. Take a look at the way lxml does it in the
apihelpers.pxi source file, or read the XML spec on character content.


More information about the Python-list mailing list