3 ­ž‘e­ã@s,ddlZddlZdd„Zdd„Zdd„ZdS)éNc CsTt|tƒrtjd|ƒSy$|jdƒ}tjd|ƒ}|jdƒ}Wntk rNYnX|S)NZNFDzutf-8)Ú isinstanceÚstrÚ unicodedataÚ normalizeÚdecodeÚencodeÚ UnicodeError)Úpath©r ú>/tmp/pip-build-vlmub77e/setuptools/setuptools/unicode_utils.pyÚ decomposes    r c CsVt|tƒr|Stjƒpd}|df}x.|D]&}y |j|ƒStk rLw(Yq(Xq(WdS)zY Ensure that the given path is decoded, NONE when no expected encoding works zutf-8N)rrÚsysÚgetfilesystemencodingrÚUnicodeDecodeError)r Zfs_encÚ candidatesÚencr r r Úfilesys_decodes    rc Cs$y |j|ƒStk rdSXdS)z/turn unicode encoding into a functional routineN)rÚUnicodeEncodeError)Ústringrr r r Ú try_encode%s r)rr r rrr r r r Ús