EVOLUTION-MANAGER
Edit File: URLencode.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Encode or Decode a (partial) URL</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for URLencode {utils}"><tr><td>URLencode {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Encode or Decode a (partial) URL</h2> <h3>Description</h3> <p>Functions to percent-encode or decode characters in URLs. </p> <h3>Usage</h3> <pre> URLencode(URL, reserved = FALSE, repeated = FALSE) URLdecode(URL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>URL</code></td> <td> <p>a character string.</p> </td></tr> <tr valign="top"><td><code>reserved</code></td> <td> <p>logical: should ‘reserved’ characters be encoded? See ‘Details’.</p> </td></tr> <tr valign="top"><td><code>repeated</code></td> <td> <p>logical: should apparently already-encoded URLs be encoded again?</p> </td></tr> </table> <h3>Details</h3> <p>Characters in a URL other than the English alphanumeric characters and <span class="samp">- _ . ~</span> should be encoded as <code>%</code> plus a two-digit hexadecimal representation, and any single-byte character can be so encoded. (Multi-byte characters are encoded byte-by-byte.) The standard refers to this as ‘percent-encoding’. </p> <p>In addition, <span class="samp">! $ & ' ( ) * + , ; = : / ? @ # [ ]</span> are reserved characters, and should be encoded unless used in their reserved sense, which is scheme specific. The default in <code>URLencode</code> is to leave them alone, which is appropriate for <span class="samp">file://</span> URLs, but probably not for <span class="samp">http://</span> ones. </p> <p>An ‘apparently already-encoded URL’ is one containing <code>%xx</code> for two hexadecimal digits. </p> <h3>Value</h3> <p>A character string. </p> <h3>References</h3> <p>Internet STD 66 (formerly RFC 3986), <a href="https://tools.ietf.org/html/std66">https://tools.ietf.org/html/std66</a> </p> <h3>Examples</h3> <pre> (y <- URLencode("a url with spaces and / and @")) URLdecode(y) (y <- URLencode("a url with spaces and / and @", reserved = TRUE)) URLdecode(y) URLdecode(z <- "ab%20cd") c(URLencode(z), URLencode(z, repeated = TRUE)) # first is usually wanted </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>