Source

trac-gviz / trac-dev / gviz / tracgviz / util / __init__.py

Diff from to

trac-dev/gviz/tracgviz/util/__init__.py

     r"""Send an HTTP response back to the caller.
     """
     req.send_response(status)
-    req.send_header('Content-Type', mimetype)
-    if req._outcharset == 'utf-8':
-      req.send_header('Content-Length', len(response))
+    req.send_header('Content-Type', mimetype + ';charset=utf-8')
+    if isinstance(response, unicode):
+      response = response.encode('utf-8')
+    req.send_header('Content-Length', len(response))
     for k, v in dict(extra_headers).iteritems():
         req.send_header(k, v)
     req.end_headers()