diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -75,6 +75,8 @@ class converter_source(object): if not encoding: encoding = self.encoding or 'utf-8' + if isinstance(s, unicode): + return s.encode("utf-8") try: return s.decode(encoding).encode("utf-8") except: diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -278,7 +278,8 @@ class convert_svn(converter_source): def revid(self, revnum, module=None): if not module: module = self.module - return (u"svn:%s%s@%s" % (self.uuid, module, revnum)).decode(self.encoding) + return u"svn:%s%s@%s" % (self.uuid, module.decode(self.encoding), + revnum) def revnum(self, rev): return int(rev.split('@')[-1])