Fix: Open GCODE files als utf-8, replacing encoding errors
Also detect files that contain a BOM and strip it. Internal handling of GCODE file contents switched to unicode. Should take care of #1077
This commit is contained in:
1 parent
abf073340f
commit
45c92cb1f4
3 files changed
+33
-7
No files matched your search
@@ -35,7 +35,9 @@ class gcode(object):
|
||||
if os.path.isfile(filename):
|
||||
self.filename = filename
|
||||
self._fileSize = os.stat(filename).st_size
|
||||
with open(filename, "r") as f:
|
||||
|
||||
import codecs
|
||||
with codecs.open(filename, encoding="utf-8", errors="replace") as f:
|
||||
self._load(f, printer_profile, throttle=throttle)
|
||||
|
||||
def abort(self):
|
||||
|
||||
Reference in new issue
Block a user