Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable hglib: replace problematic characters as last ditch effort in fromutf

Fixes #655

Changeset cc7d19412b43

Parent ba332c3533d5

by Steve Borho

Changes to one file · Browse files at cc7d19412b43 Showing diff from parent ba332c3533d5 Diff from another changeset...

 
56
57
58
59
 
60
61
 
 
 
62
63
 
 
64
65
66
 
56
57
58
 
59
60
 
61
62
63
64
 
65
66
67
68
69
@@ -56,11 +56,14 @@
  """   try:   return s.decode('utf-8').encode(_encoding) - except UnicodeDecodeError: + except (UnicodeDecodeError, UnicodeEncodeError):   pass - except UnicodeEncodeError: + try: + return s.decode('utf-8').encode(_fallbackencoding) + except (UnicodeDecodeError, UnicodeEncodeError):   pass - return s.decode('utf-8').encode(_fallbackencoding) + u = s.decode('utf-8', 'replace') # last ditch + return u.encode(_encoding, 'replace')    _tabwidth = None  def gettabwidth(ui):