I just tripped over this one and it took some time to figure out what in blazes was going on. You may want to watch for it when porting CPython code.<br><br>I was cleaning up an input argument using <br>     s = unicode(S.strip().upper())<br>

where S is the argument supplying the value I need to convert.<br><br>When I handed the function a genuine unicode string, such as in:<br>     assert Roman(u&#39;\u217b&#39;) == 12 #unicode Roman number &#39;xii&#39; as a single charactor<br>

IronPython complains with:<br>    UnicodeEncodeError: (&#39;unknown&#39;, &#39;\x00&#39;, 0, 1, &#39;&#39;)<br><br>The Python manual says:<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">

If no optional parameters are given, <tt class="docutils literal"><span class="pre"><font style="background-color: rgb(51, 153, 255);" color="#ffffff">unicode</font>()</span></tt> will mimic the behaviour of <tt class="docutils literal"><span class="pre">str()</span></tt> except that it 
returns <font style="background-color: rgb(51, 153, 255);" color="#ffffff">Unicode</font> 
strings instead of 8-bit strings. More precisely, if <em>object</em> is a <font style="background-color: rgb(51, 153, 255);" color="#ffffff">Unicode</font> string or 
subclass it will return that <font style="background-color: rgb(51, 153, 255);" color="#ffffff">Unicode</font> string without any additional decoding applied.</blockquote><div><br>It turns out that this was already reported on codeplex as:<br>

<a href="http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=15372">http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=15372</a> <br>but the reporting party did not catch the fact that he had located an incompatibility with documented behavior.<br>

It has been setting on a back burner for some time. <br><br>Others may want to join me in voting this up.  Meanwhile I will add an unneeded exception handler to my own code.<br>--<br>Vernon Cole<br><br></div>