changeset 2843:ab75def5c15d beta

fixes #567 diff non-unicode encoding missmatch - now uses safe_unicode ass all other parts of the system
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 16 Sep 2012 20:04:23 +0200
parents 14852cad8ee7
children 7b0f803229be
files rhodecode/lib/diffs.py rhodecode/lib/vcs/utils/diffs.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/diffs.py	Sat Sep 15 22:05:49 2012 +0200
+++ b/rhodecode/lib/diffs.py	Sun Sep 16 20:04:23 2012 +0200
@@ -44,6 +44,7 @@
 from rhodecode.lib.vcs.backends.base import EmptyChangeset
 from rhodecode.lib.helpers import escape
 from rhodecode.lib.utils import make_ui
+from rhodecode.lib.utils2 import safe_unicode
 
 
 def wrap_to_table(str_):
@@ -214,7 +215,7 @@
                 self.adds += 1
             elif l.startswith('-') and not l.startswith('---'):
                 self.removes += 1
-            return l.decode('utf8', 'replace')
+            return safe_unicode(l)
 
         output = list(diffiterator)
         size = len(output)
--- a/rhodecode/lib/vcs/utils/diffs.py	Sat Sep 15 22:05:49 2012 +0200
+++ b/rhodecode/lib/vcs/utils/diffs.py	Sun Sep 16 20:04:23 2012 +0200
@@ -13,6 +13,7 @@
 
 from rhodecode.lib.vcs.exceptions import VCSError
 from rhodecode.lib.vcs.nodes import FileNode, NodeError
+from rhodecode.lib.vcs.utils import safe_unicode
 
 
 def get_udiff(filenode_old, filenode_new, show_whitespace=True):
@@ -149,7 +150,7 @@
                 self.adds += 1
             elif l.startswith('-') and not l.startswith('---'):
                 self.removes += 1
-            return l.decode('utf8', 'replace')
+            return safe_unicode(l)
 
         output = list(diffiterator)
         size = len(output)