How to get PyQt to work with Russian domains?

Faced with a problem when working with the QUrl in Python. In General terms, have such test code:

from PyQt4.QtCore import QUrl<br>
<br / >
print QUrl('http://xn--d1abbgf6aiiy.xn--p1ai/').toString()<br>



Under windows it returns the expected result:
<a href="http://xn--d1abbgf6aiiy.xn--p1ai/">xn--d1abbgf6aiiy.xn--p1ai/</a>



And under FreeBSD like this:
<a href="http://xn--d1abbgf6aiiy.xn--d1abbgf6aiiyxn--p1ai/">xn--d1abbgf6aiiy.xn--d1abbgf6aiiyxn--p1ai/</a>



PyQt here www.riverbankcomputing.co.uk/software/pyqt/download version 4.8.1
October 14th 19 at 10:42
2 answers
October 14th 19 at 10:44
I do not know what is the problem with PyQt, but it can circumvent the forced conversion of the url in the IDNA
//to encode the domain.RF xn--d1acufc.xn--p1ai
domain = domain_rf.encode('idna')
//decode xn--d1acufc.xn--p1ai in domain.Russia
domain = domain_rf.decode('idna')
forgot to say the Russian name of the domain should be in утф8, so domain_rf=u domain.Russia' - gina_Harv commented on October 14th 19 at 10:47
the fact of the matter is that the domain is already in punycode :( it is why it is wrong - Lilla.McGly commented on October 14th 19 at 10:50
then it looks like a bug in the implementation Fresnoy pyqt, or maybe you have there an older version of Python than Windows? - gina_Harv commented on October 14th 19 at 10:53
Windows stood newer — 2.6.6, put 2.6.4 on the server — gives correctly. - Lilla.McGly commented on October 14th 19 at 10:56
October 14th 19 at 10:46
If this is the case, then this degradation PyQt, and the Qt is possible. Suggest to turn it over to a direct mailing list or the bugtracker first, PyQt, and then, if you say that the problem is Qt, on the Qt bugtracker.

Find more questions by tags PythonQt