From 86a18c3ebccf737142abedfc3b3ba40296c6aecd Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 15 Jul 2022 14:09:32 +0300 Subject: catch nonUTF8 survex files, DataIssues url editor --- core/views/survex.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core/views/survex.py') diff --git a/core/views/survex.py b/core/views/survex.py index 21603bc..caeaba6 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -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): -- cgit v1.2.3