3 ]@sjddlZddlZddlZejdfejdfejdfejdfejdfejdfej dfgZ ej d Z d d Z dS) Nutf8utf16zutf16-bezutf16-leutf32zutf32-bezutf32-lescoding[:=]\s*([-\w.]+)cCsx0tD](\}}|j|r|t|dj|SqWxV|jdddD]@}|dddkrFtj|rFtj|jdjd}|j|SqFW|jtj dS) zCheck a bytes string for a BOM to correctly detect the encoding Fallback to locale.getpreferredencoding(False) like open() on Python3N r#asciiF) BOMS startswithlendecodesplit ENCODING_REsearchgroupslocalegetpreferredencoding)databomencodingliner1/tmp/pip-build-8jg9gmni/pip/pip/utils/encoding.py auto_decodes r)codecsrreBOM_UTF8 BOM_UTF16 BOM_UTF16_BE BOM_UTF16_LE BOM_UTF32 BOM_UTF32_BE BOM_UTF32_LEr compilerrrrrrs