Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: several issues with character set handling #299

Merged
merged 1 commit into from
Aug 1, 2022
Merged

fix: several issues with character set handling #299

merged 1 commit into from
Aug 1, 2022

Conversation

richard-viney
Copy link
Contributor

@richard-viney richard-viney commented Jul 30, 2022

  • Fix several character sets not working, e.g. "ISO_IR 13" and "ISO_IR 166"
  • Fix warning being shown when the "ISO_IR 6" character set is used
  • Add tests for reading encoded string data in several different character sets
  • Throw exception on an unsupported character set or multiple character sets rather than logging and continuing on (this can be overridden by setting ignoreErrors)

The new encodingMapping was based on code in pydicom as well as the DICOM spec.

@pieper
Copy link
Collaborator

pieper commented Jul 30, 2022

This is looking good - thanks for the contribution 👍

Let me know when it's ready to merge.

@richard-viney
Copy link
Contributor Author

The only additional change I think is warranted is to throw an exception on an attempt to use multiple character sets, because this isn't currently supported.

If ignoreErrors is set to true we would allow parsing to proceed and emit a warning similar to the existing one.

Seem reasonable?

- Fix several character sets not working, e.g. "ISO_IR 13" and "ISO_IR 166"
- Fix warning being shown when the "ISO_IR 6" character set is used
- Add tests for reading encoded string data in several different character sets
- Throw exception on an unsupported character set or multiple character sets rather than logging and continuing on (this can be overridden by setting ignoreErrors)
@richard-viney
Copy link
Contributor Author

I've added the changes to throw an exception on multiple character sets as well.

Setting ignoreErrors to true will allow the code to proceed past any character set issue.

@richard-viney
Copy link
Contributor Author

Good to merge now 👍

Copy link
Collaborator

@pieper pieper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 👍

@pieper pieper merged commit 0b88213 into dcmjs-org:master Aug 1, 2022
@github-actions
Copy link

github-actions bot commented Aug 1, 2022

🎉 This PR is included in version 0.24.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@richard-viney richard-viney deleted the character-set-fixes branch August 9, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants