encodeURI {httpuv} | R Documentation |
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: encodeURI, encodeURIComponent, decodeURI, decodeURIComponent
encodeURI(value) encodeURIComponent(value) decodeURI(value) decodeURIComponent(value)
value |
Character vector to be encoded or decoded. |
Intended as a faster replacement for URLencode
and
URLdecode
.
encodeURI differs from encodeURIComponent in that the former will not encode
reserved characters: ;,/?:@&=+$
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.
Encoded or decoded character vector of the same length as the input value.