diff --git a/invesalius/data/vtk_utils.py b/invesalius/data/vtk_utils.py index e69b449..8044f01 100644 --- a/invesalius/data/vtk_utils.py +++ b/invesalius/data/vtk_utils.py @@ -140,12 +140,12 @@ class Text(object): # UnicodeEncodeError because they have non-ascii characters. To avoid # that we encode in utf-8. if sys.platform == 'win32': - self.mapper.SetInput(value.encode("utf-8")) + self.mapper.SetInput(value.encode("utf-8", errors='replace')) else: try: self.mapper.SetInput(value.encode("latin-1")) except(UnicodeEncodeError): - self.mapper.SetInput(value.encode("utf-8")) + self.mapper.SetInput(value.encode("utf-8", errors='replace')) def SetCoilDistanceValue(self, value): if isinstance(value, int) or isinstance(value, float): -- libgit2 0.21.2