# HG changeset patch # User Marcin Kuzminski # Date 2012-09-16 18:04:23 # Node ID ab75def5c15dd82fab6aee23cd3cc011e4d939d1 # Parent 14852cad8ee7196cf429c795dc3f61b5527454bb fixes #567 diff non-unicode encoding missmatch - now uses safe_unicode ass all other parts of the system diff --git a/rhodecode/lib/diffs.py b/rhodecode/lib/diffs.py --- a/rhodecode/lib/diffs.py +++ b/rhodecode/lib/diffs.py @@ -44,6 +44,7 @@ from rhodecode.lib.vcs.nodes import File 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 @@ class DiffProcessor(object): 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) diff --git a/rhodecode/lib/vcs/utils/diffs.py b/rhodecode/lib/vcs/utils/diffs.py --- a/rhodecode/lib/vcs/utils/diffs.py +++ b/rhodecode/lib/vcs/utils/diffs.py @@ -13,6 +13,7 @@ from mercurial.match import match 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 @@ class DiffProcessor(object): 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)