<doc>
  <legacy_id>2027</legacy_id>
  <name>URLEncode</name>
  <type>function</type>
  <syntax>
    <example>the URLEncode of <i>formString</i></example>
    <example>URLEncode(<i>formString</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Text and Data Processing</category>
    <category>Networks &amp; Communication</category>
  </classification>
  <references>
    <command tag="post">post Command</command>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> a <keyword tag="string">string</keyword> that has been transformed so that it can be posted to an <keyword tag="http">HTTP</keyword> <glossary tag="server">server</glossary> as a <keyword tag="URL">URL</keyword>.</summary>
  <examples>
    <example>URLEncode("ABC123") <code><i>-- returns "ABC123"</i></code></example>
    <example>URLEncode("Test string $$") <code><i>-- returns "Test+string+%24%24"</i></code></example>
    <example>put URLEncode("http://www.example.net/document.html") into newURL</example>
  </examples>
  <description>
    <p>Use the <b>URLEncode</b> <control_st tag="function">function</control_st> to <glossary tag="encode">encode</glossary> a <keyword tag="URL">URL</keyword> so it can be safely posted to an <keyword tag="http">HTTP</keyword> <glossary tag="server">server</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>formString</i> is any <keyword tag="string">string</keyword>, or any <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>URLEncode</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <i>formString</i>, with spaces converted to "<code>+</code>" and characters other than letters and numbers converted to their hexadecimal <glossary tag="Escape key">escape</glossary> representation.</p><p/><p><b>Comments:</b></p><p>Letters and numbers (alphanumeric characters) are not transformed by the <b>URLEncode</b> <control_st tag="function">function</control_st>. The representation used for non-alphanumeric characters is a percent sign followed by two <glossary tag="hexadecimal">hexadecimal</glossary> digits. For example, the <glossary tag="ASCII">ASCII value</glossary> of the <keyword tag="character">character</keyword> <code> ~ </code>is 126; the hexadecimal equivalent of 126 is 7E. So wherever the <keyword tag="character">character</keyword> <code> ~ </code><a/>appears in the formString, it is converted to "<code>%7E</code>".</p>
  </description>
</doc>