Commits

Anonymous committed fa4bb5f

tracelog: fallback to system encoding if hglib not available

Comments (0)

Files changed (1)

 try:
     from hggtk.hglib import toutf
 except ImportError:
+    import locale
+    _encoding = locale.getpreferredencoding()
     def toutf(s):
-        return s
+        return s.decode(_encoding, 'replace').encode('utf-8')
 
 class TraceLog():
     def __init__(self):