I have 600 records that I need to be linked on a website. As clickable urls. But when I have the URL's, they only link to the 1st set of text before a space. So is there a code in QGIS that I can put in to alleviate this. I have tried: replace( "url"," ") with "%20" But this requires some more work.
Answer
There's more than just space that is not "URL safe".
If you are looking to URL encode your strings, try (for Python 2):
import urllib
url = urllib.urlencode(url)
This will handle spaces and a whole lot more.
This post has a quick table of the different characters you need to encode.
No comments:
Post a Comment