hggtk/status: fix display error of multi-byte text and filenames
authorTK Soh <teekaysoh@yahoo.com>
Wed, 23 Apr 2008 15:18:27 +0100
changeset 1133 66736cfd76fe
parent 1132 4aa359b291c0
child 1134 aadb7858fe11
hggtk/status: fix display error of multi-byte text and filenames Looks like courier font can't handle multi-byte characters, specifically Chinese (and many other Asian languages?), which triggered this bugfix.
hggtk/gdialog.py
hggtk/status.py
--- a/hggtk/gdialog.py	Wed Apr 23 15:18:20 2008 +0100
+++ b/hggtk/gdialog.py	Wed Apr 23 15:18:27 2008 +0100
@@ -173,9 +173,9 @@
 
     def _parse_config(self):
         # defaults    
-        self.fontcomment = 'courier 10'
-        self.fontdiff = 'courier 10'
-        self.fontlist = 'courier 9'
+        self.fontcomment = 'monospace 10'
+        self.fontdiff = 'monospace 10'
+        self.fontlist = 'monospace 9'
         self.diffopts = ''
         self.diffcmd = ''
         self.diffbottom = ''
--- a/hggtk/status.py	Wed Apr 23 15:18:20 2008 +0100
+++ b/hggtk/status.py	Wed Apr 23 15:18:27 2008 +0100
@@ -473,7 +473,7 @@
                 difftext.seek(0)
                 iter = buffer.get_start_iter()
                 for line in difftext:
-                    line = util.fromlocal(line)
+                    line = toutf(line)
                     if line.startswith('---') or line.startswith('+++'):
                         buffer.insert_with_tags_by_name(iter, line, 'header')
                     elif line.startswith('-'):