From da24d36143f92c4dc97a889a42d8a7ab38db2b75 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Junqueira Amorim Date: Tue, 28 Mar 2017 13:44:01 -0300 Subject: [PATCH] Fixed problem in windows 7/10 to show spacing --- invesalius/data/vtk_utils.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/invesalius/data/vtk_utils.py b/invesalius/data/vtk_utils.py index 372ff28..ed4a99e 100644 --- a/invesalius/data/vtk_utils.py +++ b/invesalius/data/vtk_utils.py @@ -131,10 +131,14 @@ class Text(object): # With some encoding in some dicom fields (like name) raises a # UnicodeEncodeError because they have non-ascii characters. To avoid # that we encode in utf-8. - try: - self.mapper.SetInput(value.encode("latin-1")) - except(UnicodeEncodeError): - self.mapper.SetInput(value.encode("utf-8")) + + if sys.platform == 'win32': + self.mapper.SetInput(value.encode("utf-8")) + else: + try: + self.mapper.SetInput(value.encode("latin-1")) + except(UnicodeEncodeError): + self.mapper.SetInput(value.encode("utf-8")) def SetPosition(self, position): self.actor.GetPositionCoordinate().SetValue(position[0], -- libgit2 0.21.2