2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 21:17:07 +00:00

catch nonUTF8 survex files, DataIssues url editor

This commit is contained in:
Philip Sargent
2022-07-15 14:09:32 +03:00
parent 5582d545a1
commit 86a18c3ebc
2 changed files with 21 additions and 5 deletions

View File

@@ -119,9 +119,14 @@ class SvxForm(forms.Form):
print(">>> >>> WARNING - svx file not found, showing TEMPLATE SVX",fname, flush=True)
self.template = True
return survextemplatefile
fin = open(fname, "r",encoding='utf8',newline='')
svxtext = fin.read()
fin.close()
try:
fin = open(fname, "r",encoding='utf8',newline='')
svxtext = fin.read()
fin.close()
except:
fin = open(fname, "r",encoding='iso-8859-1',newline='')
svxtext = fin.read()
fin.close()
return svxtext
def DiffCode(self, rcode):