ソースを参照

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

Matthew Wang 12 年 前
コミット
c2f3622c8a
共有1 個のファイルを変更した2 個の追加0 個の削除を含む
  1. 2
    0
      cdiff.py

+ 2
- 0
cdiff.py ファイルの表示

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