<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Matt,<br><br>&gt; &gt; it seems like I really want a Unicode version of string.maketrans()  <br>&gt; &gt; and string.translate(), which is deprecated.<br>&gt; <br>&gt; No, neither of those are deprecated.  The only deprecated functions in  <br>&gt; the string module are the ones listed here:<br>&gt; http://docs.python.org/lib/node42.html<br><br>Check that URL again: string.translate() IS deprecated, but string.maketrans() is not.<br>unicode.translate() is not deprecated.<br>However, unicode.translate() will not take the optional third argument 'deletechars'<br>which string.translate() did.<br>Some people have called for it to add this to be backwards-compatible.<br><br>So I can't see where to get the functionality I want.<br>For now, to get me unstuck, I wrote a Unicode regex search-and-replace and I<br>just iterate that over the entire input XML tree. Crude but gets me out of jail for now.<br><br>By the way, the XML is coming in via ElementTree's parse() method. I see some references<br>in Unicode tutorials to creating a custom codec in order to get the translate()<br>functionality, but ET doesn't have any hook for supporting that.<br><br>(PS Thanks for your article, but it seemed to be about converting from ASCII apostrophes<br>to Unicode ones, not the reverse, which is more tricky.)<br><br>Regards,<br>Stephen<br><br /><hr />The i’m Talkaton. Can 30-days of conversation change the world? <a href='http://www.imtalkathon.com/?source=EML_WLH_Talkathon_ChangeWorld' target='_new'>Find out now.</a></body>
</html>