cec804c97165

web: temp fix for unicode in diffs
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 13 Jun 2010 12:50:19 -0400
parents b39562553ee2
children ed09b19b1ba7
branches/tags (none)
files review/templates/diff.html review/web_ui.py

Changes

--- a/review/templates/diff.html	Sun Jun 13 12:43:46 2010 -0400
+++ b/review/templates/diff.html	Sun Jun 13 12:50:19 2010 -0400
@@ -38,7 +38,7 @@
                     <tr class="{{ line_type }} {% if not read_only or allow_anon %} commentable {% endif %} line-{{ line['number'] }}">
                         <td class="linenumber">{{ line['number'] }}</td>
                         <td class="addrem-{{ line_type }}">{% if line_type == 'add' %}+{% elif line_type == 'rem' %}-{% endif %}</td>
-                        <td class="code"><code>{{ line['content'][1:]|escape }}</code></td>
+                        <td class="code"><code>{{ utils['decode'](line['content'][1:])|escape }}</code></td>
                     </tr>
                 {% endwith %}
 
--- a/review/web_ui.py	Sun Jun 13 12:43:46 2010 -0400
+++ b/review/web_ui.py	Sun Jun 13 12:50:19 2010 -0400
@@ -56,6 +56,7 @@
     'categorize_signoffs': _categorize_signoffs,
     'map': map,
     'str': str,
+    'decode': lambda s: s.decode('utf-8'),
 }
 
 def _render(template, **kwargs):