branch: externals/dicom
commit da1af03bfae2ba845cd9f27654d97a382ed0d212
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
dicom--read: Use latin-1 encoding
---
dicom.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dicom.el b/dicom.el
index 9b51ca7ca4..903d4e7c23 100644
--- a/dicom.el
+++ b/dicom.el
@@ -256,15 +256,15 @@ progress:${percent-pos}%%' %s) & disown"
(defun dicom--read (file)
"Read DICOM FILE and return list of items."
(with-temp-buffer
- (if (eq 0 (call-process "dcm2xml" nil t nil
- "--quiet" "--charset-assume" "latin-1"
- "--convert-to-utf8" file))
- (let ((dicom-attribute-filter (mapconcat (lambda (x) (format "%s" x))
- dicom-attribute-filter
- "\\|")))
- (dicom--convert (dom-child-by-tag (libxml-parse-xml-region)
'data-set)))
- (message "DICOM: Reading DICOM metadata with dcm2xml failed")
- nil)))
+ (let ((coding-system-for-read 'latin-1)
+ (coding-system-for-write 'latin-1))
+ (unless (eq 0 (call-process "dcm2xml" nil t nil
+ "--quiet" "--charset-assume" "latin-1" file))
+ (error "DICOM: Reading DICOM metadata with dcm2xml failed")))
+ (let ((dicom-attribute-filter (mapconcat (lambda (x) (format "%s" x))
+ dicom-attribute-filter
+ "\\|")))
+ (dicom--convert (dom-child-by-tag (libxml-parse-xml-region)
'data-set)))))
(defun dicom--image-buffer ()
"Return image buffer or throw an error."