pydicom.values.convert_single_string

pydicom.values.convert_single_string(byte_string: bytes, encodings: list[str] | None = None, vr: str | None = None) str[source]

Return decoded text, ignoring backslashes and trailing spaces.

Parameters:
  • byte_string (bytes) – The encoded string.

  • encodings (list of str, optional) – A list of the character encoding schemes used to encode the text.

  • vr (str) – The value representation of the element. Needed for validation.

Returns:

The decoded text.

Return type:

str