diff --git a/src/gitchangelog/gitchangelog.py b/src/gitchangelog/gitchangelog.py index ba3e855..e5f2b75 100755 --- a/src/gitchangelog/gitchangelog.py +++ b/src/gitchangelog/gitchangelog.py @@ -246,6 +246,13 @@ def _execute_child(self, args, executable, preexec_fn, close_fds, """ +## +## ENCODING +## + +sys.stdout.reconfigure(encoding='utf-8') + + ## ## Shell command helper functions ## @@ -476,7 +483,7 @@ def curryfy(f): ## def file_get_contents(filename): - with open(filename) as f: + with open(filename, encoding="utf-8") as f: out = f.read() if not PY3: if not isinstance(out, unicode): @@ -1589,11 +1596,12 @@ def versions_data_iter(repository, revlist=None, encoding=log_encoding) for commit in commits: - if any(re.search(pattern, commit.subject) is not None + commit_message = "%s\n%s" % (commit.subject, commit.body) + if any(re.search(pattern, commit_message) is not None for pattern in ignore_regexps): continue - matched_section = first_matching(section_regexps, commit.subject) + matched_section = first_matching(section_regexps, commit_message) ## Finally storing the commit in the matching section