Unicode fix for SVX display and edit page

This commit is contained in:
Philip Sargent
2020-05-31 20:46:12 +01:00
parent fe515e9f01
commit 09aedecc3b
2 changed files with 5 additions and 5 deletions

View File

@@ -95,7 +95,7 @@ class SvxForm(forms.Form):
if mbeginend.group(1) != mbeginend.group(2):
return "Error: mismatching beginend"
fout = open(fname, "w")
fout = open(fname, "wb")
res = fout.write(rcode.encode("latin1"))
fout.close()
return "SAVED"
@@ -109,7 +109,7 @@ class SvxForm(forms.Form):
fin = open(settings.SURVEX_DATA + self.data['filename'] + ".log", "rb")
log = fin.read()
fin.close()
log = re.sub("(?s).*?(Survey contains)", "\\1", log)
log = re.sub(b"(?s).*?(Survey contains)", "\\1", log)
return log