title: Amazon S3 URL Encoding
body: <p>If I have a file name that is </p>
  
  <p><code>
  a'd1 &amp; "[tttt]" + 'sq.jpg
  </code></p>
  
  <p>When this gets uploaded to Amazon S3, it gets converted to this</p>
  
  <p><code>
  a'd1 &amp; %22[tttt]%22 + 'sq.jpg
  </code></p>
  
  <p>So the double quotes are URL encoded and the filename itself is changed.</p>
  
  <p>The file has to be fetched using the encoded URL</p>
  
  <p><code>
  a%27d1+%26+%2522%5Btttt%5D%2522+%2B+%27sq.jpg
  </code>
  So the encoding rules seem to be:</p>
  
  <pre><code>": %2522  (double encoded)
  Space: + 
  &amp;: %26 
  [: %5B
  ]: %5D
  +: %2B 
  </code></pre>
  
  <p>Is there a way to determine all the rules that S3 requires? Normal javascript encoding with (encodeURI or even encodeURIComponent) won't work</p>