Skip to content

Commit 342b273

Browse files
authored
Merge pull request #407 from fabianschlebusch/master
Force xml writer to use utf-8 encoding on all operating systems Travis fails because of homebrew update timeout. Thus, merging this, fixing travis later
2 parents 89b7fde + 8b40334 commit 342b273

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

odml/tools/xmlparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def write_file(self, filename, local_style=False, custom_template=None):
199199
# calculate the data before opening the file in case we get any exception
200200
data = str(self)
201201

202-
with open(filename, "w") as file:
202+
with open(filename, "w", encoding = "utf-8") as file:
203203
file.write("%s\n" % XML_HEADER)
204204
if not local_style and not custom_template:
205205
file.write("%s\n" % EXTERNAL_STYLE_HEADER)

test/test_xml_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setUp(self):
2020

2121
doc = odml.Document()
2222
sec = doc.create_section(name="sec", type="test")
23-
_ = sec.create_property(name="prop", value=['a', 'b', 'c'])
23+
_ = sec.create_property(name="prop", value=['a', 'b', 'c', 'μ'])
2424

2525
self.doc = doc
2626
self.writer = XMLWriter(doc)

0 commit comments

Comments
 (0)