<div dir="ltr">Dear bindings team, is there a way to get this issue looked at?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 May 2013 22:34, Shaheed Haque <span dir="ltr"><<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I wonder if we can get PyKDE4 fixed?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br>
<br><div class="gmail_quote">On 3 May 2013 22:10, Shaheed Haque <span dir="ltr"><<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gah, I see what you mean.<div><br></div><div>I guess I'd vote for any solution that minimised the amount of source changes needed if/when i18n is fixed, so I like your idea of sticking in the library. I guess anybody with an objection needs to speak up...</div>


</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 May 2013 21:17, Philipp A. <span dir="ltr"><<a href="mailto:flying-sheep@web.de" target="_blank">flying-sheep@web.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div>well, it is:<br><br>>>> from sys import version_info<br>>>> version_info[:2]<br>(3, 3)<br>>>> from PyKDE4.kdecore import versionString, i18n<br>>>> versionString()<br>



'4.10.2'<br>>>> i18n('·'.encode('utf-8'))<br></div>'·'<br>>>> print(i18n('·'))<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>



UnicodeEncodeError: 'ascii' codec can't encode character '\xb7' in position 0: ordinal not in range(128)<br><br></div>note that the result of i18n *is* a unicode string, and i18n *accepts* unicode strings, but only if those unicode strings happen to only contain ascii – just like in the bad old python2 times.<br>



<br></div>so i18n is buggy on KDE 4.10, and we have to work around it.<br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/3 Shaheed Haque <span dir="ltr"><<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>></span><br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Just after I hit "send", I found this:<div><br></div><div><a href="http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg14058.html" target="_blank">http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg14058.html</a> </div>




<div><br></div><div>which suggests this is not an issue???</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 May 2013 20:42, Shaheed Haque <span dir="ltr"><<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Philipp,<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div>On 3 May 2013 19:56, Philipp A. <span dir="ltr"><<a href="mailto:flying-sheep@web.de" target="_blank">flying-sheep@web.de</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi, i’ve seen some uses of kdecore.i18n popping up in Paté plugins, and have some recommendations:<br>





<div><br></div>2. It takes more than one argument. so for the sake of consistency instead of doing the ugly<br>
    i18n(b'foo %(name)s.') % { 'name': 'bar'}<br><div>or even the better<br></div><div>    i18n(b'foo {name}.').format(name='bar')<br></div>we should do the Qt-style<br>    i18n(b'foo %1.', 'bar')<br>






<br></div><div>1.  i18n takes byte strings. even on python3. this means that every time a developer accustomed to python2 who doesn’t know it tries to use it, the plugin WILL break for python3 users.<br></div></div></div>





</div></div></blockquote><div><br></div></div><div><div>I've been using the argument syntax of the third form, but simply specified quoted strings (i.e. without the "b" prefix). Without really thinking about it, I had assumed that i18n would have done something plausible on Python2 (not sure exactly what though!), and on Python3 it would just be Unicode all the way. I'd certainly prefer not avoid having to use "b" all over the place.</div>





<div><br></div><div><a href="https://github.com/Werkov/PyQt4/blob/master/examples/tools/i18n/i18n.py" target="_blank">https://github.com/Werkov/PyQt4/blob/master/examples/tools/i18n/i18n.py</a><br></div><div><br></div><div>




seems to suggest that something like that is possible, but when I went looking for some docs on this, but could not see an obvious spec. Do you have a reference handy?</div>
</div><div><br></div><div>Thanks, Shaheed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div>
<div dir="ltr"><div><div><div><div><br></div><div>we have to come up with a solution.<br>
<br></div><div>there is a possible solution here, but it involves a fairly convoluted i18n replacement:<br><a href="https://projects.kde.org/projects/kde/applications/kate/repository/revisions/master/entry/addons/kate/pate/src/plugins/python_console_ipython/python_console_ipython.py#L36" target="_blank">https://projects.kde.org/projects/kde/applications/kate/repository/revisions/master/entry/addons/kate/pate/src/plugins/python_console_ipython/python_console_ipython.py#L36</a><br>






<br></div><div>should we add that function to libkatepate and call it a day?<br></div></div></div></div></div>
<br></div>_______________________________________________<br>
KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org" target="_blank">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org" target="_blank">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org" target="_blank">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>