@m_hume wrote:
Hi
Im new to jinja templating and have a question regarding url encoding.With the movie_name = "Turner & Hooch"
in my config i have something likeurl: 'https://myserver.com?mn={{movie_name}}'
which gives me the url
https://myserver.com?mn=Turner%20&%20Hooch
The ampersand doesn't get url encoded somn="Turner "
if i use escape
url: 'https://myserver.com?mn={{movie_name|escape}}'
i get the url
https://myserver.com?mn=Turner%20&%20Hooch
The ampersand doesn't get url encoded somn="Turner "
if i use urlencode i get a double encoding issue
url: 'https://myserver.com?mn={{movie_name|urlencode}}'
gives me the url
https://myserver.com?mn=Turner%2520%2526%2520Hooch
Now i've settled with the final method and do a url decode in the web page logic that the url loads.
My question. Is there a better way without a double encode?
My first post here, sorry if off topic/wrong place/anything someone new might do thats not right
Cheers
mh
Posts: 2
Participants: 2