Commits

Anonymous committed 5a9bcfa

hggtk/history: fix UTF encoding error in committer field

Developer Note:
experimenting with mercurial.util.fromlocal() for UTF encoding

Comments (0)

Files changed (2)

hggtk/changeset.py

     def _fill_buffer(self, buf, rev, ctx, filelist):
         def title_line(title, text, tag):
             pad = ' ' * (12 - len(title))
-            buf.insert_with_tags_by_name(eob, title + pad + text, tag)
+            utext = util.fromlocal(title + pad + text)
+            buf.insert_with_tags_by_name(eob, utext, tag)
             buf.insert(eob, "\n")
 
         # TODO: Add toggle for gmtime/localtime

hggtk/vis/treemodel.py

             tags = ', '.join(self.repo.nodetags(node))
 
             if '<' in ctx.user():
-                author = self.author_re.sub('', ctx.user()).strip(' ')
+                author = util.fromlocal((self.author_re.sub('',
+                        ctx.user()).strip(' ')))
             else:
-                author = util.shortuser(ctx.user())
+                author = util.fromlocal(util.shortuser(ctx.user()))
 
             date = strftime("%Y-%m-%d %H:%M:%S", gmtime(ctx.date()[0]))