Commit da24d36143f92c4dc97a889a42d8a7ab38db2b75
1 parent
de267fb3
Exists in
master
and in
12 other branches
Fixed problem in windows 7/10 to show spacing
Showing
1 changed file
with
8 additions
and
4 deletions
Show diff stats
invesalius/data/vtk_utils.py
@@ -131,10 +131,14 @@ class Text(object): | @@ -131,10 +131,14 @@ class Text(object): | ||
131 | # With some encoding in some dicom fields (like name) raises a | 131 | # With some encoding in some dicom fields (like name) raises a |
132 | # UnicodeEncodeError because they have non-ascii characters. To avoid | 132 | # UnicodeEncodeError because they have non-ascii characters. To avoid |
133 | # that we encode in utf-8. | 133 | # that we encode in utf-8. |
134 | - try: | ||
135 | - self.mapper.SetInput(value.encode("latin-1")) | ||
136 | - except(UnicodeEncodeError): | ||
137 | - self.mapper.SetInput(value.encode("utf-8")) | 134 | + |
135 | + if sys.platform == 'win32': | ||
136 | + self.mapper.SetInput(value.encode("utf-8")) | ||
137 | + else: | ||
138 | + try: | ||
139 | + self.mapper.SetInput(value.encode("latin-1")) | ||
140 | + except(UnicodeEncodeError): | ||
141 | + self.mapper.SetInput(value.encode("utf-8")) | ||
138 | 142 | ||
139 | def SetPosition(self, position): | 143 | def SetPosition(self, position): |
140 | self.actor.GetPositionCoordinate().SetValue(position[0], | 144 | self.actor.GetPositionCoordinate().SetValue(position[0], |