mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Adding support for non ascii characters when reporting
This commit is contained in:
@@ -151,7 +151,7 @@ class Txt(Console):
|
|||||||
print(self.text)
|
print(self.text)
|
||||||
|
|
||||||
def to_file(self, filepath):
|
def to_file(self, filepath):
|
||||||
with open(filepath, "w") as outfile:
|
with open(filepath, "w", encoding="utf-8") as outfile:
|
||||||
return outfile.write(self.text)
|
return outfile.write(self.text)
|
||||||
|
|
||||||
|
|
||||||
@@ -273,8 +273,8 @@ class Json(Reporter):
|
|||||||
def to_file(self, filepath):
|
def to_file(self, filepath):
|
||||||
import json
|
import json
|
||||||
|
|
||||||
with open(filepath, "w") as outfile:
|
with open(filepath, "w", encoding="utf-8") as outfile:
|
||||||
return json.dump(self.results, outfile)
|
return json.dump(self.results, outfile, ensure_ascii=False)
|
||||||
|
|
||||||
|
|
||||||
class Html(Json):
|
class Html(Json):
|
||||||
@@ -303,7 +303,7 @@ class Html(Json):
|
|||||||
import pystache
|
import pystache
|
||||||
|
|
||||||
with open(os.path.join(cwd, "templates", "report.html"), "r") as file:
|
with open(os.path.join(cwd, "templates", "report.html"), "r") as file:
|
||||||
with open(filepath, "w") as outfile:
|
with open(filepath, "w", encoding="utf-8") as outfile:
|
||||||
return outfile.write(pystache.render(file.read(), self.results))
|
return outfile.write(pystache.render(file.read(), self.results))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user