View Single Post
Old 08-22-2011, 05:35 PM   #100
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,471
Karma: 27757440
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote