Decodes the encoded data using the specified encoding. Args: encoded_data (bytes): The data to decode. encoding (Encoding): The encoding type used for decoding. Returns: str: The decoded string.
(self, encoded_data: bytes, encoding: Encoding)
| 85 | self.special_char2 = special_char2 |
| 86 | |
| 87 | def decode(self, encoded_data: bytes, encoding: Encoding) -> str: |
| 88 | """ |
| 89 | Decodes the encoded data using the specified encoding. |
| 90 | |
| 91 | Args: |
| 92 | encoded_data (bytes): The data to decode. |
| 93 | encoding (Encoding): The encoding type used for decoding. |
| 94 | |
| 95 | Returns: |
| 96 | str: The decoded string. |
| 97 | """ |
| 98 | if len(encoded_data) == 0: |
| 99 | return "" |
| 100 | return self.decode_with_encoding(encoded_data, encoding) |
| 101 | |
| 102 | def decode_with_encoding(self, encoded_data: bytes, encoding: Encoding) -> str: |
| 103 | """ |