[XML-SIG] outputting non-ascii strings

Juergen Hermann Juergen Hermann" <jh@web.de
Thu, 23 May 2002 01:25:37 +0200


On Wed, 22 May 2002 21:39:54 +0100, Matt Patterson wrote:

>Is there an easy way around this problem? 

Is there a problem? With UTF-8, you need no stinkin' entities!

But if you insist on burning cpu cycles:

>>> ''.join([c.encode('ascii', 'ignore') or "&#%d;" % ord(c) for c in u'=
\u8314=E4=F6=FC=DF?abc']) 
'&#33556;&#132;&#148;&#129;&#225;?abc' 


Ciao, J=FCrgen