(data, encoding)
| 1 | def decode(data, encoding): |
| 2 | try: |
| 3 | return data.decode(encoding) |
| 4 | except UnicodeDecodeError as e: |
| 5 | if encoding.lower() == 'utf-8': |
| 6 | return _decode_utf8_with_mixes(data) |
| 7 | |
| 8 | raise e |
| 9 | |
| 10 | |
| 11 | def _decode_utf8_with_mixes(data): |
nothing calls this directly
no test coverage detected