Answer the question
In order to leave comments, you need to log in
How to make PyQt work with Russian domains?
I ran into a problem when working with QUrl in python. In general, we have the following test code:
from PyQt4.QtCore import QUrl<br/>
<br/>
print QUrl('http://xn--d1abbgf6aiiy.xn--p1ai/').toString()<br/>
<a href="http://xn--d1abbgf6aiiy.xn--p1ai/">xn--d1abbgf6aiiy.xn--p1ai/</a>
<a href="http://xn--d1abbgf6aiiy.xn--d1abbgf6aiiyxn--p1ai/">xn--d1abbgf6aiiy.xn--d1abbgf6aiiyxn--p1ai/</a>
Answer the question
In order to leave comments, you need to log in
I don’t know what the problem is with PyQt, but it can be bypassed by forced conversion of the url to idna
//encode domain.rf in xn--d1acufc.xn--p1ai
domain = domain_rf.encode('idna')
//decode xn--d1acufc. xn--p1ai to domain.rf
domain = domain_rf.decode('idna')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question