title: Problem with encoding in Django templates
body: <p>I'm having problems using {% ifequal s1 "some text" %} to compare strings with extended characters in Django templates. When string s1 contains ascii characters >127, I get exceptions in the template rendering. What am I doing wrong? I'm using UTF-8 coding throughout the rest of application in both the data, templates and Python code without any problems.</p>
  
  <p>views.py</p>
  
  <pre><code>def test(request):
      return render_to_response("test.html", {
                                              "s1": "dados",
                                              "s2": "aprovação",
                                              }
                                )
  </code></pre>
  
  <p>test.html</p>
  
  <pre><code>s1={{s1}}&lt;br&gt;
  s2={{s2}}&lt;br&gt;
  
  {% ifequal s1 "dados" %}
    s1="dados" is true
  {% endifequal %}
  
  {% ifequal s1 "aprovação" %}
    s1="aprovação" is true
  {% endifequal %}
  
  {% comment %}
  The following two comparions cause the following exception:
  Caught an exception while rendering: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)
  
  {% ifequal s2 "dados" %}
    s2="dados" is true
  {% endifequal %}
  
  {% ifequal s2 "aprovação" %}
    s2="aprovação" is true
  {% endifequal %}
  {% endcomment %}
  
  {% ifequal s2 u"dados" %}
    s2="dados" is true
  {% endifequal %}
  
  {% comment %}
  The following comparison causes the following exception:
  Caught an exception while rendering: 'ascii' codec can't encode characters in position 8-9: ordinal not in range(128)
  {% ifequal s2 u"aprovação" %}
    s2="aprovação" is true
  {% endifequal %}
  {% endcomment %}
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>s1=dados
  s2=aprovação
  s1="dados" is true 
  </code></pre>