- pydicom.charset.convert_encodings(encodings: None | str | MutableSequence[str]) list[str] ¶
Convert DICOM encodings into corresponding Python encodings.
Handles some common spelling mistakes and issues a warning in this case.
Handles stand-alone encodings: if they are the first encodings, additional encodings are ignored, if they are not the first encoding, they are ignored. In both cases, a warning is issued.
Invalid encodings are replaced with the default encoding with a respective warning issued, if
WARN, or an exception is raised if it is set to
listof Python encodings corresponding to the DICOM encodings. If an encoding is already a Python encoding, it is returned unchanged. Encodings with common spelling errors are replaced by the correct encoding, and invalid encodings are replaced with the default encoding if
reading_validation_modeis not set to
- Return type:
LookupError – If encodings contains a value that could not be converted and