title: If a URL contains a quote how do you specify the rel=canonical value?
body: <p>Say the path of your URL is:</p>
  
  <pre><code>/thisisa"quote/helloworld/
  </code></pre>
  
  <p>Then how do you create the <code>rel=canonical</code> URL?</p>
  
  <p>Is this kosher?</p>
  
  <pre><code>&lt;link rel="canonical" href="/thisisa&amp;amp;quot;/helloworld/" /&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>To clarify, I'm getting a form submission, I need to convert part of the query string into the URL. So the steps are:</p>
  
  <ol>
  <li><em>.htaccess</em> does the redirect</li>
  <li>PHP processes a directory as a query string.</li>
  <li>The query string will be dynamically inserted into the:
  
  <ul>
  <li>Title,</li>
  <li>Description,</li>
  <li>Keywords</li>
  <li>Canonical URL.</li>
  <li>Spit back into the form's input box</li>
  </ul></li>
  </ol>
  
  <p>So I need to know which processing has to be done each step of the way...On the first cut, this is my take:</p>
  
  <ul>
  <li>Title: <code>htmlspecialchars($rawQuery)</code></li>
  <li>Description: <code>htmlspecialchars($rawQery)</code></li>
  <li>Keywords: <code>htmlspecialchars($rawQuery)</code></li>
  <li>Canonical URL: This is the tricky part. It must match the same URL <em>.htaccess</em> redirects to but even so, I think the raw query is unsafe because quotes can cause JavaScript injection. Worried about <code>urlencode($rawquery)</code> since it's coming from the URL, wouldn't it already be URL-encoded?</li>
  <li>Spit back into form: <code>htmlspecialchars($rawQuery)</code></li>
  </ul>