XML/HTML Encoding problem

Dale Strickland-Clark dale at riverhall.nospam.co.uk
Tue May 23 08:10:52 EDT 2006


Thanks, Duncan. That did the trick.

If you're EuroPythoning, I'll buy you a drink.

Cheers.


Duncan Booth wrote:

> First up, when I repeat what you did I don't get the same output. toxml()
> without an encoding argument produces a unicode string, and no encoding
> attribute in the <?xml ...?>
> 
> toxml() only takes a single encoding argument, so unfortunately there
> isn't any way to tell it what to do for unicode characters which are not
> supported in the encoding you are using. However, if you then encode the
> unicode output to ascii with entity escapes, I think you should be alright
> (unless I've missed something):
> You lose the encoding at the top of the output, but since the output is
> entirely ascii I don't think that matters.

-- 
Dale Strickland-Clark
Riverhall Systems www.riverhall.co.uk




More information about the Python-list mailing list