3

Q'ícäã@s8ddlZddlZddlmZdd„Zdd„Zdd„ZdS)	éN)ÚsixcCsVt|tjƒrtjd|ƒSy$|jdƒ}tjd|ƒ}|jdƒ}Wntk
rPYnX|S)NZNFDzutf-8)Ú
isinstancerÚ	text_typeÚunicodedataÚ	normalizeÚdecodeÚencodeÚUnicodeError)Úpath©rú>/tmp/pip-build-l_bcah40/setuptools/setuptools/unicode_utils.pyÚ	decomposes
r
cCsXt|tjƒr|Stjƒpd}|df}x.|D]&}y
|j|ƒStk
rNw*Yq*Xq*WdS)zY
    Ensure that the given path is decoded,
    NONE when no expected encoding works
    zutf-8N)rrrÚsysÚgetfilesystemencodingrÚUnicodeDecodeError)r
Zfs_encÚ
candidatesÚencrrrÚfilesys_decodes

rcCs$y
|j|ƒStk
rdSXdS)z/turn unicode encoding into a functional routineN)rÚUnicodeEncodeError)ÚstringrrrrÚ
try_encode's
r)rrZsetuptools.externrr
rrrrrrÚ<module>s