fixed mac text encoding at always utf-8

git-svn-id: http://comictagger.googlecode.com/svn/trunk@348 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville 2013-01-25 06:14:51 +00:00
parent 7186c6792a
commit ccde71f9d0

View File

@ -449,15 +449,16 @@ def process_file_cli( filename, opts, settings, match_results ):
print u"renamed '{0}' -> '{1}' {2}".format(os.path.basename(filename), new_name, suffix)
#-----------------------------
def main():
# try to make stdout encodings happy for unicode
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
if platform.system() == "Darwin":
preferred_encoding = "utf-8"
else:
preferred_encoding = locale.getpreferredencoding()
sys.stdout = codecs.getwriter(preferred_encoding)(sys.stdout)
opts = Options()
opts.parseCmdLineArgs()