Commit 3f6aaf0fad71dfc2784679668b440704120d4465

Authored by Paulo Henrique Junqueira Amorim
1 parent 7e9ac0f3

FIX: Fixed problem ocurred in Promed 2265

Showing 1 changed file with 7 additions and 2 deletions   Show diff stats
invesalius/reader/dicom.py
@@ -1259,8 +1259,13 @@ class Parser(): @@ -1259,8 +1259,13 @@ class Parser():
1259 if (data): 1259 if (data):
1260 name = data.strip() 1260 name = data.strip()
1261 encoding = self.GetEncoding() 1261 encoding = self.GetEncoding()
1262 - # Returns a unicode decoded in the own dicom encoding  
1263 - return name.decode(encoding) 1262 +
  1263 + try:
  1264 + # Returns a unicode decoded in the own dicom encoding
  1265 + return name.decode(encoding)
  1266 + except(UnicodeEncodeError):
  1267 + return name
  1268 +
1264 return "" 1269 return ""
1265 1270
1266 def GetPatientID(self): 1271 def GetPatientID(self):