diff options
-rw-r--r-- | io_scene_x3d/import_x3d.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 22f7ee47..d5494d6b 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -1266,13 +1266,14 @@ def gzipOpen(path): if data is None: try: - filehandle = open(path, 'rU') + filehandle = open(path, 'rU', encoding='utf-8', errors='surrogateescape') data = filehandle.read() filehandle.close() except: - pass + import traceback + traceback.print_exc() else: - data = data.decode('utf-8', "replace") + data = data.decode(encoding='utf-8', errors='surrogateescape') return data |