<div dir="ltr"><div>Just out of curiosity, how does it work in CPython 3.4?<br><br></div>(That's where we should be headed. All of this fiddling with obscure str bugs in 2.7 is a bit of a waste, IMHO.)<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 3:59 PM, Markus Schaber <span dir="ltr"><<a href="mailto:m.schaber@codesys.com" target="_blank">m.schaber@codesys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I just noticed that the non-BMP Unicode Literals don't seem to work correctly in IronPython, this seems to work correctly in cPython 2.7.8:<br>
<br>
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32<br>
>>> u"\U00010042"<br>
u'\U00010042'<br>
<br>
IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.18444 (32-bit)<br>
>>> u"\U00010042"<br>
'B'<br>
<br>
I guess this truncation is caused by the UTF-16 nature of .NET strings. I guess the most sensible thing IronPython could do here is to create the correct surrogate pair:<br>
<br>
>>> System.Text.Encoding.UTF32.GetString((0x42, 0, 1, 0))<br>
u'\ud800\udc42'<br>
<br>
<br>
Best regards<br>
<br>
Markus Schaber<br>
<br>
CODESYS(r) a trademark of 3S-Smart Software Solutions GmbH<br>
<br>
Inspiring Automation Solutions<br>
<br>
3S-Smart Software Solutions GmbH<br>
Dipl.-Inf. Markus Schaber | Product Development Core Technology<br>
Memminger Str. 151 | 87439 Kempten | Germany<br>
Tel. +49-831-54031-979 | Fax +49-831-54031-50<br>
<br>
E-Mail: <a href="mailto:m.schaber@codesys.com">m.schaber@codesys.com</a> | Web: <a href="http://www.codesys.com" target="_blank">http://www.codesys.com</a> | CODESYS store: <a href="http://store.codesys.com" target="_blank">http://store.codesys.com</a><br>
CODESYS forum: <a href="http://forum.codesys.com" target="_blank">http://forum.codesys.com</a><br>
<br>
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915<br>
<br>
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received<br>
this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure<br>
or distribution of the material in this e-mail is strictly forbidden.<br>
<br>
_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">https://mail.python.org/mailman/listinfo/ironpython-users</a><br>
</blockquote></div><br></div>