<?xml version="1.0"?>
<?xml-stylesheet href="/transform" type="text/xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bs="http://purl.org/ontology/bibo/status/" xmlns:ci="https://vocab.methodandstructure.com/content-inventory#" xmlns:dct="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" lang="en" prefix="bibo: http://purl.org/ontology/bibo/ bs: http://purl.org/ontology/bibo/status/ ci: https://vocab.methodandstructure.com/content-inventory# dct: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# xhv: http://www.w3.org/1999/xhtml/vocab# xsd: http://www.w3.org/2001/XMLSchema#" vocab="http://www.w3.org/1999/xhtml/vocab#" xml:lang="en">
  <head>
    <title property="dct:title">Other Non-Alpha-Numeric Characters in HTTP URLs</title>
    <base href="https://doriantaylor.com/policy/other-non-alpha-numeric-characters-in-http-urls"/>
    <link href="../document-stats#Ec5vxFqXXcAexl1nXqGb1L" rev="ci:document"/>
    <link href="../elsewhere" rel="alternate bookmark" title="Elsewhere"/>
    <link href="../this-site" rel="alternate index" title="This Site"/>
    <link href="http://purl.org/ontology/bibo/status/published" rel="bibo:status"/>
    <link href="" rel="ci:canonical" title="Other Non-Alpha-Numeric Characters in HTTP URLs"/>
    <link href="../lexicon/#EzqXIsriaILFcWjXdS7FbI" rel="dct:audience" title="Software Developer"/>
    <link href="../person/dorian-taylor#me" rel="dct:creator" title="Dorian Taylor"/>
    <link href="http-url-path-syntax-constraints" rel="dct:references next" title="HTTP URL Path Syntax Constraints"/>
    <link href="uri-syntax-constraints" rel="dct:references up" title="URI Syntax Constraints"/>
    <link href="../lexicon/#EnewYu-MeZVXNc97q_-jAI" rel="dct:subject" title="Web Development"/>
    <link href="../person/dorian-taylor" rel="meta" title="Who I Am"/>
    <link about="../" href="../3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="../" href="../f07f5044-01bc-472d-9079-9b07771b731c" rel="alternate" type="application/atom+xml"/>
    <link about="../" href="../this-site" rel="alternate"/>
    <link about="../" href="../elsewhere" rel="alternate"/>
    <link about="../" href="../e341ca62-0387-4cea-b69a-cdabc7656871" rel="alternate" type="application/atom+xml"/>
    <link about="../verso/" href="../3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="../verso/" href="../this-site" rel="alternate"/>
    <link about="../verso/" href="../elsewhere" rel="alternate"/>
    <meta content="other-non-alpha-numeric-characters-in-http-urls" datatype="xsd:token" property="ci:canonical-slug"/>
    <meta content="TL;DR there are a lot more available than you'd expect." name="description" property="dct:abstract"/>
    <meta content="2008-07-30T23:58:57+00:00" datatype="xsd:dateTime" property="dct:created"/>
    <meta content="other-non-alpha-numeric-characters-in-http-urls" property="dct:identifier"/>
    <meta content="2008-07-31T02:16:54+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-09-03T08:31:44+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-09-03T10:29:11+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2008-10-09T02:02:01+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2009-03-04T00:43:00+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T04:18:52+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T15:10:50+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta about="../person/dorian-taylor#me" content="Dorian Taylor" name="author" property="foaf:name"/>
    <meta content="summary" name="twitter:card"/>
    <meta content="@doriantaylor" name="twitter:site"/>
    <meta content="Other Non-Alpha-Numeric Characters in HTTP URLs" name="twitter:title"/>
    <meta content="TL;DR there are a lot more available than you'd expect." name="twitter:description"/>
    <object>
      <nav>
        <ul>
          <li>
            <a href="http-url-path-parameter-syntax" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">HTTP URL Path Parameter Syntax</span>
            </a>
          </li>
          <li>
            <a href="http-url-path-syntax-constraints" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">HTTP URL Path Syntax Constraints</span>
            </a>
          </li>
          <li>
            <a href="hyphen-vs-underscore" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">Hyphen vs. Underscore</span>
            </a>
          </li>
          <li>
            <a href="tongue-twisters-and-vocabulary-gaps-in-uris" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">Tongue-Twisters and Vocabulary Gaps in URIs</span>
            </a>
          </li>
          <li>
            <a href="uri-syntax-constraints" rev="dct:references" typeof="bibo:Report">
              <span property="dct:title">URI Syntax Constraints</span>
            </a>
          </li>
          <li>
            <a href="../document-stats#Ec5vxFqXXcAexl1nXqGb1L" rev="ci:document" typeof="qb:Observation">
              <span>urn:uuid:739bf116-a5d7-4700-b7b1-9759d7a866f5</span>
            </a>
          </li>
        </ul>
      </nav>
    </object>
  </head>
  <body about="" id="EMCxIbzgRkHfRYbl0k_SAI" typeof="bibo:Report">
    <p>In <acronym title="Uniform Resource Identifier">URI</acronym>s, and by extension <acronym title="Hypertext Transfer Protocol">HTTP</acronym> <acronym title="Uniform Resource Locator">URL</acronym>s, some characters have explicit meaning built-in, and others have meaning when you want them to:</p>
    <ul>
      <li><em>General Delimiters</em> are laid out in <a href="http://tools.ietf.org/html/rfc3986" title="RFC 3986 &#x2014; Uniform Resource Identifier (URI): Generic Syntax" rel="dct:references">the <acronym title="Uniform Resource Identifier">URI</acronym> specification</a>. They are given as <samp>: / ? # [ ] @</samp>, and their meanings are <em>fixed</em>.</li>
      <li>The semantics of <em>sub-delimiters</em> can be defined by an interaction designer. They consist of <samp>! $ &amp; ' ( ) * + , ; =</samp> .</li>
      <li><em>Unreserved characters</em>, aside from the standard anglo-centric set of letters and digits, comprise <samp>- . <a href="hyphen-vs-underscore" title="Hyphen vs. Underscore" rel="dct:references xhv:prev">_</a> ~</samp> .</li>
      <li>The percent character <samp>%</samp> is <em>always</em> used to escape other characters which are out of range, and can therefore not be used literally.</li>
      <li>The <a href="http://tools.ietf.org/html/rfc2396" title="RFC 2396 &#x2014; Uniform Resource Identifiers (URI): Generic Syntax" rel="dct:references">preceding <acronym title="Uniform Resource Identifier">URI</acronym> specification</a> defined the sets <samp title="Delimiters">&lt; &gt; # % "</samp> and <samp title="Unwise">{ } | \ ^ [ ] `</samp> as being <em class="parenthesis" title="although the astute will notice that the fragment identifier and the escape character are part of the first set">expressly forbidden</em>. The <a href="http://tools.ietf.org/html/rfc3986" title="RFC 3986 &#x2014; Uniform Resource Identifier (URI): Generic Syntax" rel="dct:references">current specification</a> simply leaves those not already mentioned out of the definition, along with the other characters in the <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ascii" title="ASCII(7) &#x2014; OpenBSD Reference Manual" rel="dct:references">ASCII table</a> left unmentioned.</li>
    </ul>
    <section id="EG9tBMYcbxm6dR7Myq1E_J">
      <h2>Why Care About This?</h2>
      <p>The chief incentive to define constraints like this is to maximize the semantic value of your <abbr title="World Wide Web">Web</abbr> asset's <acronym title="Uniform Resource Identifier">URI</acronym>s in the wild. You will be able to give hints at a glance that would otherwise be missing &#x2014; or worse &#x2014; misleading. Here are some examples:</p>
      <blockquote id="Eo10HUQA2XV6Fon1V5tUAL"><samp>http://news.example.com/money/$5.2-billion-merger</samp></blockquote>
      <p>Here, the dollar sign and the period denote the proper currency and value of the transaction, a figure which would otherwise be lost. The period <samp>.</samp> has been repurposed from its <a href="file-extensions-in-http-url-paths" title="File Extensions in HTTP URL Paths" rel="dct:references">original, mundane duty</a> to <span class="parenthesis" title="once again, not everyone uses a period as a decimal">serve as the decimal</span>.</p>
      <blockquote id="ED5PX_w905J_pN-n3HeY5I"><samp>http://blog.example.com/wutchoo-talkin'-bout-willis!?</samp></blockquote>
      <p>In this example, the apostrophe denotes the verbal contraction, and the punctuation adds emphasis. Note that the question mark <samp>?</samp> is placed at the end of the path, denoting an empty query string, which can safely be <span class="parenthesis" title="there will invariably be some contention between no query string and an empty query string, but for the most part both will be a no-op">ignored by the <span class="parenthesis before" title="server-side">application</span></span>.</p>
      <blockquote id="EryCGSWyUCddVabX99_CnL"><samp>https://spam.example.com/viagra-only-$2-per-pill*</samp></blockquote>
      <p>In this example, the dollar sign denotes the price of the product, and the asterisk implies that there is a catch, potentially contained within the <span class="parenthesis before" title="probably shady">document</span> to which this <acronym title="Uniform Resource Identifier">URI</acronym> refers.</p>
      <p>Another important aspect of knowing about these characters is <span class="parenthesis" title="and sticking with">choosing</span> consistent constraints for <a href="http-url-path-parameter-syntax" title="HTTP URL Path Parameter Syntax" rel="dct:references">path</a> and <a href="http-url-query-string-syntax-constraints" title="HTTP URL Query String Syntax Constraints" rel="dct:references">query string</a> parameters.</p>
      <p>Of course, treading off the beaten path in this way is not without its risks:</p>
      <ul>
        <li><a rel="dct:references xhv:section" href="mistaken-interpretations-of-uris" title="Mistaken Interpretations of URIs">Mistaken Interpretations</a></li>
        <li><a rel="dct:references xhv:section" href="tongue-twisters-and-vocabulary-gaps-in-uris" title="Tongue-Twisters and Vocabulary Gaps in URIs">Tongue-Twisters and Vocabulary Gaps</a></li>
      </ul>
    </section>
  </body>
</html>
