[XML-SIG] XML Unicode and UTF-8

n.youngman at ntlworld.com n.youngman at ntlworld.com
Thu Aug 5 11:45:11 CEST 2004

I'm trying to create an XML document, containing mostly ASCII, but potentially containing some unicode characters. I want to convert this all to UTF-8, but no matter what I try, I get an ASCII codec error.

I have tried using codec.open( filename, "w", "utf-8" )

I have tried converting the unicode inline with string.encode( "utf-8").

I have tried various combination of the above.

I have tried UTF-7

I always get an ASCII codec error.

My environment is Python 2.3.4 built on redHat 7.3

What's the correct approach to this problem? 

Has anyone done this successfully?

Email provided by http://www.ntlhome.com/

More information about the XML-SIG mailing list