curl_escape: URL encoding

Description Usage Arguments Examples

View source: R/escape.R

Description

Escape all special characters (i.e. everything except for a-z, A-Z, 0-9, '-', '.', '_' or '~') for use in URLs.

Usage

1
2
3

Arguments

url

A character vector (typically containing urls or parameters) to be encoded/decoded

Examples

1
2
3
4
5
6
7
8
# Escape strings
out <- curl_escape("foo = bar + 5")
curl_unescape(out)

# All non-ascii characters are encoded
mu <- "\u00b5"
curl_escape(mu)
curl_unescape(curl_escape(mu))

Example output

[1] "foo = bar + 5"
[1] "%C2%B5"
[1] "<U+00B5>"

curl documentation built on June 23, 2021, 9:07 a.m.