diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index d3cc0e6..84be16d 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -1224,7 +1224,14 @@ class Parser(): return "" if (data): - return str(data) + name = data.strip() + encoding = self.GetEncoding() + try: + # Returns a unicode decoded in the own dicom encoding + return name.decode(encoding, 'replace') + except(UnicodeEncodeError): + return name + return "" def GetPatientAge(self): -- libgit2 0.21.2