ôYÍã@sLddlZddlZddlZdd„Zdd„Zdd„ZdS)éNc Csot|tjƒr"tjd|ƒSy4|jdƒ}tjd|ƒ}|jdƒ}Wntk rjYnX|S)NZNFDzutf-8)Ú isinstanceÚsixÚ text_typeÚ unicodedataÚ normalizeÚdecodeÚencodeÚ UnicodeError)Úpath©r ú>/tmp/pip-build-3puug3g5/setuptools/setuptools/unicode_utils.pyÚ decomposes r c Csrt|tjƒr|Stjƒp%d}|df}x7|D]/}y|j|ƒSWq;tk riw;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Úencr r r Úfilesys_decodes   rc Cs.y|j|ƒSWntk r)dSYnXdS)z/turn unicode encoding into a functional routineN)rÚUnicodeEncodeError)Ústringrr r r Ú try_encode's r)rrrr rrr r r r Ús