Commit e0a64d3e3155f05f55bc71f4e7ef46507d431e19
1 parent
685ff1d7
Exists in
master
Fixed problem with invalid utf8 char in vtk text
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
invesalius/data/vtk_utils.py
... | ... | @@ -140,12 +140,12 @@ class Text(object): |
140 | 140 | # UnicodeEncodeError because they have non-ascii characters. To avoid |
141 | 141 | # that we encode in utf-8. |
142 | 142 | if sys.platform == 'win32': |
143 | - self.mapper.SetInput(value.encode("utf-8")) | |
143 | + self.mapper.SetInput(value.encode("utf-8", errors='replace')) | |
144 | 144 | else: |
145 | 145 | try: |
146 | 146 | self.mapper.SetInput(value.encode("latin-1")) |
147 | 147 | except(UnicodeEncodeError): |
148 | - self.mapper.SetInput(value.encode("utf-8")) | |
148 | + self.mapper.SetInput(value.encode("utf-8", errors='replace')) | |
149 | 149 | |
150 | 150 | def SetCoilDistanceValue(self, value): |
151 | 151 | if isinstance(value, int) or isinstance(value, float): | ... | ... |