Commit 83bd621f8803ba2e89191d33d037fc787a0b11c7
1 parent
bed72ec3
Exists in
master
and in
13 other branches
Fixed error in patient id decode
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
invesalius/reader/dicom.py
... | ... | @@ -1295,7 +1295,10 @@ class Parser(): |
1295 | 1295 | if (data): |
1296 | 1296 | encoding = self.GetEncoding() |
1297 | 1297 | # Returns a unicode decoded in the own dicom encoding |
1298 | - return data.decode(encoding, 'replace') | |
1298 | + try: | |
1299 | + return data.decode(encoding, 'replace') | |
1300 | + except(UnicodeEncodeError): | |
1301 | + return data | |
1299 | 1302 | return "" |
1300 | 1303 | |
1301 | 1304 | ... | ... |