title: Encoding file name in Python while downloading from GAE Blobstore
body: <p>I am writing a simple app which prompts user to select a file to upload which is then listed on the webpage and available for download. I am using Blobstore to perform these operations. 
  The app should also work for files of names containing non-ASCII characters (like Chinese and Japanese).
  I have managed the app to properly upload and list the files of such names using the following code in the main.py:</p>
  
  <pre><code>class MainScreen(BaseHandler):
      def get(self):
          upload_url = blobstore.create_upload_url('/upload')
          uploadedBlobs[]
          for item in blobstore.BlobInfo.all():
              uploadedBlobs.append(str(item.key(),item.filename)) 
          #uploadedBlobs is a list of tuples each containing two elements: blob key and blob name (file name) which is then sent to template (main.html)
          template_values = {
          'formAction': upload_url,
          'listofBlobs': uploadedBlobs, 
          }
          template = JINJA_ENVIRONMENT.get_template('main.html')
          self.response.write(template.render(template_values))
  
  class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler,BaseHandler):
      def post(self):
          upload = self.get_uploads('file')
          blob_info = upload_files[0]
          self.redirect('/')
  
  
  class ViewFiles(blobstore_handlers.BlobstoreDownloadHandler,BaseHandler):
      def get(self, blob_key):
           blob_key = str(urlib.unquote(blob_key))
           blob_info = blobstore.BlobInfo.get(blob_key)
           self.send_blob(blob_info, save_as=urlib.quote(blob_info.filename.encode('utf-8')))
  </code></pre>
  
  <p>Then in the template (main.html) I use the following code to decode file names and display them properly:</p>
  
  <pre><code>{%for item in listOfBlobs%}
      &lt;li&gt;&lt;a href="/serve/{{item[0]}}"&gt;{{item[1]}}&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>The problem is that when I click the link to download a file with a non-ASCII name, its name is not properly saved on the local drive but is instead assuming a form like that:
  %E4%B8%AD.txt (for a text file with names such as: 日本語.txt or 中文.txt). For files using only ASCII in their names, everything works well.
  Does anybody have any idea how to make the browser save the file with the name that is displayed in it instead of converting it to Unicode string in hex (I believe)?
  Any help greatly appreciated. </p>