<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Special character handling in URLs — Bazaar 2.6.0 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.6.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/bzr.ico"/> <link rel="top" title="Bazaar 2.6.0 documentation" href="../index.html" /> <link rel="up" title="Bazaar User Reference" href="index.html" /> <link rel="next" title="URL Identifiers" href="urlspec-help.html" /> <link rel="prev" title="Status Flags" href="status-flags-help.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="urlspec-help.html" title="URL Identifiers" accesskey="N">next</a></li> <li class="right" > <a href="status-flags-help.html" title="Status Flags" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.6.0)</a> »</li> <li><a href="index.html" accesskey="U">Bazaar User Reference</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="special-character-handling-in-urls"> <h1>Special character handling in URLs<a class="headerlink" href="#special-character-handling-in-urls" title="Permalink to this headline">ΒΆ</a></h1> <p>Bazaar allows locations to be specified in multiple ways, either:</p> <blockquote> <div><ul class="simple"> <li>Fully qualified URLs</li> <li>File system paths, relative or absolute</li> </ul> </div></blockquote> <p>Internally bzr treats all locations as URLs. For any file system paths that are specified it will automatically determine the appropriate URL representation, and escape special characters where necessary.</p> <p>There are a few characters which have special meaning in URLs and need careful handling to avoid ambiguities. Characters can be escaped with a % and a hex value in URLs. Any non-ASCII characters in a file path will automatically be urlencoded when the path is converted to a URL.</p> <p>URLs represent non-ASCII characters in an encoding defined by the server, but usually UTF-8. The % escapes should be of the UTF-8 bytes. Bazaar tries to be generous in what it accepts as a URL and to print them in a way that will be readable.</p> <p>For example, if you have a directory named ‘/tmp/%2False’ these are all valid ways of accessing the content (0x2F, or 47, is the ASCII code for forward slash):</p> <div class="highlight-python"><pre>cd /tmp bzr log /tmp/%2False bzr log %2False bzr log file:///tmp/%252False bzr log file://localhost/tmp/%252False bzr log file:%252False</pre> </div> <p>These are valid but do not refer to the same file:</p> <div class="highlight-python"><pre>bzr log file:///tmp/%2False (refers to a file called /tmp/\/alse) bzr log %252False (refers to a file called /tmp/%252False)</pre> </div> <p>Comma also has special meaning in URLs, because it denotes <a class="reference internal" href="#segment-parameters">segment parameters</a></p> <p><span class="target" id="segment-parameters">segment parameters</span>: <a class="reference external" href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a> (section 3.3)</p> <p>Comma is also special in any file system paths that are specified. To use a literal comma in a file system path, specify a URL and URL encode the comma:</p> <div class="highlight-python"><pre>bzr log foo,branch=bla # path "foo" with the segment parameter "branch" set to "bla" bzr log file:foo%2Cbranch=bla # path "foo,branch=bla" bzr log file:foo,branch=bla # path "foo" with segment parameter "branch" set to "bla"</pre> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="status-flags-help.html" title="previous chapter">Status Flags</a></p> <h4>Next topic</h4> <p class="topless"><a href="urlspec-help.html" title="next chapter">URL Identifiers</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-reference/url-special-chars-help.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="urlspec-help.html" title="URL Identifiers" >next</a></li> <li class="right" > <a href="status-flags-help.html" title="Status Flags" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.6.0)</a> »</li> <li><a href="index.html" >Bazaar User Reference</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2011 Canonical Ltd. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>