quoting is only supposed to apply to the path component of a URL. So you'd do it like this:
1) Start unencoded
2) Use urlparse.urlsplit to split the url into components.
3) Quote the correct components (path and query) encoded as UTF-8
quote(component.encode('utf-8'))
4) Use urlparse.urlunsplit to reconstitute the url
5) Use QUrl.fromEncoded
Last edited by kovidgoyal; 08-22-2011 at 05:41 PM.
|