Commit c5b377e3 authored by root's avatar root
Browse files

fixed encoding issues

parent e5635f35
......@@ -32,7 +32,7 @@ dblp_data_tree = etree.parse('dblp-2017-11-01.xml', dblp_parser)
root = dblp_data_tree.getroot()
# Output files.
dblp_bracket = open('dblp.bracket', 'w')
dblp_bracket = open('dblp.bracket', mode='w', encoding="utf8")
print("--- Processing each child of DBLP's root.")
......@@ -4,10 +4,10 @@ import random
number = int(sys.argv[1])
filename = sys.argv[2]
with open(filename) as f:
with open(filename, encoding='utf-8') as f:
lines = f.readlines()
linestoprint = random.sample(range(len(lines)), number)
for ln in linestoprint:
print(lines[ln], end='')
print(lines[ln].encode('utf8'), end='')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment