1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
================
Handling Result
================
When initiating search upon a buffer, bytes or file you can assign the return value and fully exploit it.
::
my_byte_str = 'Bсеки човек има право на образование.'.encode('cp1251')
# Assign return value so we can fully exploit result
result = from_bytes(
my_byte_str
).best()
print(result.encoding) # cp1251
Using CharsetMatch
----------------------------
Here, ``result`` is a ``CharsetMatch`` object or ``None``.
.. autoclass:: charset_normalizer.CharsetMatch
:members:
|