Current Path: > > opt > alt > python311 > lib > python3.11 > site-packages > pip > > _vendor > chardet
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
cli | Directory | - | - | |
metadata | Directory | - | - | |
__init__.py | File | 3271 bytes | November 13 2023 22:00:31. | |
big5freq.py | File | 31254 bytes | November 13 2023 22:00:31. | |
big5prober.py | File | 1757 bytes | November 13 2023 22:00:31. | |
chardistribution.py | File | 9411 bytes | November 13 2023 22:00:31. | |
charsetgroupprober.py | File | 3839 bytes | November 13 2023 22:00:31. | |
charsetprober.py | File | 5110 bytes | November 13 2023 22:00:31. | |
codingstatemachine.py | File | 3590 bytes | November 13 2023 22:00:31. | |
compat.py | File | 1200 bytes | November 13 2023 22:00:31. | |
cp949prober.py | File | 1855 bytes | November 13 2023 22:00:31. | |
enums.py | File | 1661 bytes | November 13 2023 22:00:31. | |
escprober.py | File | 3950 bytes | November 13 2023 22:00:31. | |
escsm.py | File | 10510 bytes | November 13 2023 22:00:31. | |
eucjpprober.py | File | 3749 bytes | November 13 2023 22:00:31. | |
euckrfreq.py | File | 13546 bytes | November 13 2023 22:00:31. | |
euckrprober.py | File | 1748 bytes | November 13 2023 22:00:31. | |
euctwfreq.py | File | 31621 bytes | November 13 2023 22:00:31. | |
euctwprober.py | File | 1747 bytes | November 13 2023 22:00:31. | |
gb2312freq.py | File | 20715 bytes | November 13 2023 22:00:31. | |
gb2312prober.py | File | 1754 bytes | November 13 2023 22:00:31. | |
hebrewprober.py | File | 13838 bytes | November 13 2023 22:00:31. | |
jisfreq.py | File | 25777 bytes | November 13 2023 22:00:31. | |
jpcntx.py | File | 19643 bytes | November 13 2023 22:00:31. | |
langbulgarianmodel.py | File | 105675 bytes | November 13 2023 22:00:31. | |
langgreekmodel.py | File | 99549 bytes | November 13 2023 22:00:31. | |
langhebrewmodel.py | File | 98754 bytes | November 13 2023 22:00:31. | |
langhungarianmodel.py | File | 102476 bytes | November 13 2023 22:00:31. | |
langrussianmodel.py | File | 131158 bytes | November 13 2023 22:00:31. | |
langthaimodel.py | File | 103290 bytes | November 13 2023 22:00:31. | |
langturkishmodel.py | File | 95924 bytes | November 13 2023 22:00:31. | |
latin1prober.py | File | 5370 bytes | November 13 2023 22:00:31. | |
mbcharsetprober.py | File | 3413 bytes | November 13 2023 22:00:31. | |
mbcsgroupprober.py | File | 2012 bytes | November 13 2023 22:00:31. | |
mbcssm.py | File | 25481 bytes | November 13 2023 22:00:31. | |
sbcharsetprober.py | File | 6136 bytes | November 13 2023 22:00:31. | |
sbcsgroupprober.py | File | 4309 bytes | November 13 2023 22:00:31. | |
sjisprober.py | File | 3774 bytes | November 13 2023 22:00:31. | |
universaldetector.py | File | 12503 bytes | November 13 2023 22:00:31. | |
utf8prober.py | File | 2766 bytes | November 13 2023 22:00:31. | |
version.py | File | 242 bytes | November 13 2023 22:00:31. |
######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA ######################### END LICENSE BLOCK ######################### from .universaldetector import UniversalDetector from .enums import InputState from .version import __version__, VERSION __all__ = ['UniversalDetector', 'detect', 'detect_all', '__version__', 'VERSION'] def detect(byte_str): """ Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError('Expected object of type bytes or bytearray, got: ' '{}'.format(type(byte_str))) else: byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) return detector.close() def detect_all(byte_str): """ Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError('Expected object of type bytes or bytearray, got: ' '{}'.format(type(byte_str))) else: byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) detector.close() if detector._input_state == InputState.HIGH_BYTE: results = [] for prober in detector._charset_probers: if prober.get_confidence() > detector.MINIMUM_THRESHOLD: charset_name = prober.charset_name lower_charset_name = prober.charset_name.lower() # Use Windows encoding name instead of ISO-8859 if we saw any # extra Windows-specific bytes if lower_charset_name.startswith('iso-8859'): if detector._has_win_bytes: charset_name = detector.ISO_WIN_MAP.get(lower_charset_name, charset_name) results.append({ 'encoding': charset_name, 'confidence': prober.get_confidence(), 'language': prober.language, }) if len(results) > 0: return sorted(results, key=lambda result: -result['confidence']) return [detector.result]
SILENT KILLER Tool