elementtree and gbk encoding

Diez B. Roggisch deets at nospam.web.de
Wed Mar 15 05:42:40 EST 2006


Hi,

> good advice, but note that an envelope (e.g a HTTP request or response
> body) may override the encoding in the XML file itself.  if this arrives
> in a MIME message with the proper charset information, it's perfectly okay
> to leave out the encoding from the file.

It might be practical - still, a xml parser _should_ puke on you, ans
certainly some will (elemnttree not being one of those, I know :)) 

So even if it goes over the wire headerless, you should be prepending it
when dealing with teh data later.

Regards,

Diez



More information about the Python-list mailing list