title: Flask: rendering unicode characters in template
body: <p>In a Flask app I'm working on, I need to display Unicode text to users. When testing them out in the Python shell, my functions seem to work fine:</p>
  
  <pre><code>&gt;&gt;&gt; sr = rym_scraper.get_artist_info('sigur ros')
  &gt;&gt;&gt; print sr.name # a string encoded using str.encode('utf8')
  Sigur Rós
  </code></pre>
  
  <p>When I actually test it out in the app, I get this:</p>
  
  <pre><code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
  </code></pre>
  
  <p>With the final exception being in the template it produces this stack trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__
      return self.wsgi_app(environ, start_response)
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
      response = self.make_response(self.handle_exception(e))
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
      response = self.full_dispatch_request()
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
      rv = self.dispatch_request()
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/Users/eric/projects/whatshouldilistento/app/app.py", line 29, in enter_band
      return band_info(form.name.data)
    File "/Users/eric/projects/whatshouldilistento/app/app.py", line 45, in band_info
      return render_template('band_info.html')
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/templating.py", line 125, in render_template
      context, ctx.app)
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/flask/templating.py", line 107, in _render
      rv = template.render(context)
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
      return self.environment.handle_exception(exc_info, True)
    File "/Users/eric/Envs/whatshouldilistento/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "/Users/eric/projects/whatshouldilistento/app/templates/band_info.html", line 9, in top-level template code
      &lt;div&gt;{{ message }}&lt;/div&gt;
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
  </code></pre>
  
  <p>How can I display the Unicode string in my rendered template?</p>