Commit c5b377e3 authored by root's avatar root
Browse files

fixed encoding issues

parent e5635f35
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.")

+2 −2
Original line number Diff line number Diff line
@@ -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='')