Skip to content

Commit

Permalink
Fix for #60: Adding ISO_6 (#71)
Browse files Browse the repository at this point in the history
I'm adding ISO_6 which some of our DICOMs have.

Also fixing error message: because name is the iterator, we should spit it out, when there's no match.

This fixes #60.
  • Loading branch information
wkoszek authored Apr 26, 2020
1 parent 795ab75 commit 8abd37b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dicomio/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
// Mapping of DICOM charset name to golang encoding/htmlindex name. "" means
// 7bit ascii.
var htmlEncodingNames = map[string]string{
"ISO_IR 6": "iso-8859-1",
"ISO 2022 IR 6": "iso-8859-1",
"ISO_IR 13": "shift_jis",
"ISO 2022 IR 13": "shift_jis",
Expand Down Expand Up @@ -93,7 +94,7 @@ func ParseSpecificCharacterSet(encodingNames []string) (CodingSystem, error) {
dicomlog.Vprintf(2, "dicom.ParseSpecificCharacterSet: Using coding system %s", name)
if htmlName, ok := htmlEncodingNames[name]; !ok {
// TODO(saito) Support more encodings.
return CodingSystem{}, fmt.Errorf("dicom.ParseSpecificCharacterSet: Unknown character set '%s'. Assuming utf-8", encodingNames[0])
return CodingSystem{}, fmt.Errorf("dicom.ParseSpecificCharacterSet: Unknown character set '%s'. Assuming utf-8", name)
} else {
if htmlName != "" {
d, err := htmlindex.Get(htmlName)
Expand Down

0 comments on commit 8abd37b

Please sign in to comment.