git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@216 830e0280-6d2a-0410-9c65-932aecc39d9d
Michal Ludvig authored on 2008/08/19 22:45:26... | ... |
@@ -14,6 +14,7 @@ import errno |
14 | 14 |
import pwd, grp |
15 | 15 |
import glob |
16 | 16 |
import traceback |
17 |
+import codecs |
|
17 | 18 |
|
18 | 19 |
from copy import copy |
19 | 20 |
from optparse import OptionParser, Option, OptionValueError, IndentedHelpFormatter |
... | ... |
@@ -1037,6 +1038,9 @@ if __name__ == '__main__': |
1037 | 1037 |
from S3 import Utils |
1038 | 1038 |
from S3.Exceptions import * |
1039 | 1039 |
|
1040 |
+ ## Output UTF-8 in all cases, even on output redirects |
|
1041 |
+ sys.stdout = codecs.getwriter("utf-8")(sys.stdout) |
|
1042 |
+ |
|
1040 | 1043 |
main() |
1041 | 1044 |
sys.exit(0) |
1042 | 1045 |
except SystemExit, e: |