관리-도구
편집 파일: chardetect.cpython-33.pyc
� 7�Reu c @ sq d Z d d l m Z d d l m Z m Z d d l m Z d d d � Z d d � Z e d k rm e � n d S( u Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. i ( u open( u argvu stdin( u UniversalDetectoru stdinc C si t � } x | D] } | j | � q W| j � | j } | d r] d | | d | d f Sd | Sd S( u; Return a string describing the probable encoding of a file.u encodingu %s: %s with confidence %su confidenceu %s: no resultN( u UniversalDetectoru feedu closeu result( u fileu nameu uu lineu result( ( uI /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/chardetect.pyu description_of s u description_ofc C so t t � d k r% t t t � � nF xC t d d � D]1 } t | d � � } t t | | � � Wd QXq6 Wd S( Ni u rb( u lenu argvu printu description_ofu stdinu open( u pathu f( ( uI /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/chardetect.pyu main$ s u mainu __main__N( u __doc__u iou openu sysu argvu stdinu chardet.universaldetectoru UniversalDetectoru description_ofu mainu __name__( ( ( uI /tmp/pip-zej_zi-build/pip/_vendor/requests/packages/chardet/chardetect.pyu <module> s