library(urlparse)
# Example 1:
url_encoder("foo = bar + 5")
# Example 2:
# prevent special characters being encoded:
url <- "https://example.com/path?query= 1+2"
url_encoder(url, ":/?=")
# Example 3:
url_decoder(url_encoder("foo = bar + 5"))
Run the code above in your browser using DataLab