Rev 202: Fixed UTF-8 issues. in http://bzr.daniel-watkins.co.uk/pqm/125888

Daniel Watkins daniel at daniel-watkins.co.uk
Tue Jul 15 13:52:40 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/125888

------------------------------------------------------------
revno: 202
revision-id: daniel at daniel-watkins.co.uk-20080715125120-zabo9ps4x5sl6ii8
parent: daniel at daniel-watkins.co.uk-20080710132248-spgomd25jctavk50
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: 125888
timestamp: Tue 2008-07-15 13:51:20 +0100
message:
  Fixed UTF-8 issues.
-------------- next part --------------
=== modified file 'pqm/ui/template.py'
--- a/pqm/ui/template.py	2008-07-10 13:22:48 +0000
+++ b/pqm/ui/template.py	2008-07-15 12:51:20 +0000
@@ -1,4 +1,5 @@
 html_template = """<html>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
 <head>
     <title>Patch Queue Manager</title>
 </head>

=== modified file 'pqm/ui/twistd.py'
--- a/pqm/ui/twistd.py	2008-07-10 12:48:14 +0000
+++ b/pqm/ui/twistd.py	2008-07-15 12:51:20 +0000
@@ -60,9 +60,9 @@
                                     for m in self.queue.messages])
         c.addGlobal('current_time',
                     time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))
-        c.addGlobal('status_text', self.queue.status_text)
+        c.addGlobal('status_text', self.queue.status_text.decode('utf-8'))
         text = StringIO()
-        template.expand(c, text)
+        template.expand(c, text, outputEncoding="utf-8")
         return static.Data(text.getvalue(), 'text/html')
 
     def currentlyProcessing(self):
@@ -74,7 +74,7 @@
     def getMessageDict(self, selected_project, message):
         dict = {}
         dict['submission_time'] = time.ctime(message.getSubmissionTime())
-        dict['sender'] = message.getSender()
+        dict['sender'] = message.getSender().decode('utf-8')
         try:
             projects = message.getProjects()
         except KeyError:
@@ -87,7 +87,7 @@
             dict['other'] = True
             return dict
         dict['other'] = False
-        dict['subject'] = message.getSubject()
+        dict['subject'] = message.getSubject().decode('utf-8')
         dict['commands'] = [c.asHTML() for c in message.getCommands()]
         return dict
 



More information about the bazaar-commits mailing list