OSDN Git Service

misc: support UTF-8 text in commit message to generate changelog
authorhylom <hylom@users.osdn.me>
Thu, 6 Jun 2019 06:17:15 +0000 (06:17 +0000)
committerhylom <hylom@users.osdn.me>
Thu, 6 Jun 2019 06:17:15 +0000 (06:17 +0000)
misc/make_changelog.py

index 4d6a1c4..831899b 100644 (file)
@@ -4,6 +4,7 @@ import sys
 import re
 import commands
 import datetime
+import codecs
 
 CHANGELOG_FORMAT=ur"""newslash ({describe}) unstable; urgency=low
 
@@ -14,6 +15,9 @@ CHANGELOG_FORMAT=ur"""newslash ({describe}) unstable; urgency=low
 CHANGES_FORMAT=ur"""  * {subject} ({committer}, {date})"""
 PACKAGER="Hiromichi MATSUSHIMA <hirom@osdn.jp>"
 
+sys.stdin = codecs.getreader('utf-8')(sys.stdin)
+sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
+
 def get_desc(hs):
     cmd = "git describe --tags " + hs
     rs = commands.getoutput(cmd)