Just a little reminder in all this noise...<br><br>The correct thing to do with unicode(u'a unicode string') is MAKE NO CHANGE.<br>The correct thing to do with str('an ASCII string') is MAKE NO CHANGE.<br><br>
The Zen of Python says:<br><div style="margin-left: 40px;">Explicit is better than implicit.<br>Special cases aren't special enough to break the rules.<br>In the face of ambiguity, refuse the temptation to guess.<br>
If the implementation is hard to explain, it's a bad idea.<br>
If the implementation is easy to explain, it may be a good idea.<br></div><br>IMHO, if a programmer expects str() or unicode() to make a change in the encoding of a string-like object, (s)he should be encouraged/forced to use .encode() or .decode() to get his(er) intended result.<br>
--<br>Vernon Cole<br><br>