Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wikiextractor/WikiExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def open(self, filename):
# 1 2 3 4


def load_templates(file, output_file=None):
def load_templates(file, output_file=None, encoding='utf-8'):
"""
Load templates from :param file:.
:param output_file: file where to save templates and modules.
Expand All @@ -205,7 +205,7 @@ def load_templates(file, output_file=None):
page = []
inText = False
if output_file:
output = open(output_file, 'w')
output = open(output_file, 'w', encoding=encoding)
for line in file:
#line = line.decode('utf-8')
if '<' not in line: # faster than doing re.search()
Expand Down