mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:07:08 +00:00
Import proper UTF-8.
What's the point of Python defaulting to ASCII
when JSON is explicitly defined as a binary
format with a default character encoding of
UTF-8? 🙄
This commit is contained in:
@@ -25,8 +25,8 @@ def write_file (filename, payload):
|
||||
print("Writing to", filename)
|
||||
tmpname = filename.parent / (filename.name + ".tmp")
|
||||
filename.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(tmpname, "w") as fd:
|
||||
json.dump(payload, fd, indent=4)
|
||||
with open(tmpname, "w", encoding="utf8") as fd:
|
||||
json.dump(payload, fd, indent=4, ensure_ascii=False)
|
||||
os.rename(tmpname, filename)
|
||||
|
||||
def seis_data (survey):
|
||||
|
||||
Reference in New Issue
Block a user