瀏覽代碼

Lazy fix #32 by set default encoding to utf-8

Matthew Wang 11 年之前
父節點
當前提交
c2f3622c8a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      cdiff.py

+ 2
- 0
cdiff.py 查看文件

@@ -717,6 +717,8 @@ def main():
717 717
         markup_to_pager(stream, opts)
718 718
     else:
719 719
         # pipe out stream untouched to make sure it is still a patch
720
+        if sys.hexversion < 0x03000000:
721
+            reload(sys).setdefaultencoding('utf8')
720 722
         for line in stream:
721 723
             sys.stdout.write(decode(line))
722 724