Set encoding for all text reads and writes to utf8, as windows defaults to latin1
This commit is contained in:
@@ -147,7 +147,7 @@ class GuiSessionLogView(QDialog):
|
||||
|
||||
logger.debug("Loading session log file")
|
||||
try:
|
||||
with open(logFile,mode="r") as inFile:
|
||||
with open(logFile,mode="r",encoding="utf8") as inFile:
|
||||
for inLine in inFile:
|
||||
inData = inLine.split()
|
||||
if len(inData) != 8:
|
||||
|
||||
+1
-1
@@ -390,7 +390,7 @@ class GuiMain(QMainWindow):
|
||||
|
||||
theText = None
|
||||
try:
|
||||
with open(loadFile,mode="rt") as inFile:
|
||||
with open(loadFile,mode="rt",encoding="utf8") as inFile:
|
||||
theText = inFile.read()
|
||||
except Exception as e:
|
||||
self.makeAlert(["Could not read file. The file cannot be a binary file.",str(e)], nwAlert.ERROR)
|
||||
|
||||
Reference in New Issue
Block a user