From 3f6aaf0fad71dfc2784679668b440704120d4465 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Fri, 30 Mar 2012 16:47:17 +0000 Subject: [PATCH] FIX: Fixed problem ocurred in Promed 2265 --- invesalius/reader/dicom.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index d85379c..f3e3a75 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -1259,8 +1259,13 @@ class Parser(): if (data): name = data.strip() encoding = self.GetEncoding() - # Returns a unicode decoded in the own dicom encoding - return name.decode(encoding) + + try: + # Returns a unicode decoded in the own dicom encoding + return name.decode(encoding) + except(UnicodeEncodeError): + return name + return "" def GetPatientID(self): -- libgit2 0.21.2