Is there a function to encode some text to make it URL safe (i.e. replacing spaces be with “%20”)?
Someone has already posted earlier that there is undocumented function urlquery, but the mere fact it is undocumented makes me feel uncomfortable in using it. Also it was a few years ago.
Otherwise, {{ urlquery .Params.mytext }} works just fine for me!