forked from rstudio/httpuv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathencodeURI.Rd
50 lines (43 loc) · 1.81 KB
/
encodeURI.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{encodeURI}
\alias{decodeURI}
\alias{decodeURIComponent}
\alias{encodeURI}
\alias{encodeURIComponent}
\title{URI encoding/decoding}
\usage{
encodeURI(value)
encodeURIComponent(value)
decodeURI(value)
decodeURIComponent(value)
}
\arguments{
\item{value}{Character vector to be encoded or decoded.}
}
\value{
Encoded or decoded character vector of the same length as the
input value.
}
\description{
Encodes/decodes strings using URI encoding/decoding in the same way that web
browsers do. The precise behaviors of these functions can be found at
developer.mozilla.org:
\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI}{encodeURI},
\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent}{encodeURIComponent},
\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI}{decodeURI},
\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent}{decodeURIComponent}
}
\details{
Intended as a faster replacement for \code{\link[utils]{URLencode}} and
\code{\link[utils]{URLdecode}}.
encodeURI differs from encodeURIComponent in that the former will not encode
reserved characters: \code{;,/?:@&=+$}
decodeURI differs from decodeURIComponent in that it will refuse to decode
encoded sequences that decode to a reserved character. (If in doubt, use
decodeURIComponent.)
The only way these functions differ from web browsers is in the encoding of
non-ASCII characters. All non-ASCII characters will be escaped byte-by-byte.
If conformant non-ASCII behavior is important, ensure that your input vector
is UTF-8 encoded before calling encodeURI or encodeURIComponent.
}