U
    ż|ęgä  ć                   @   s8   d dl Z d dlZd dlmZ dd Zdd Zdd ZdS )	é    N)Śsixc                 C   sV   t | tjrt d| ”S z$|  d”} t d| ”} |  d”} W n tk
rP   Y nX | S )NZNFDśutf-8)Ś
isinstancer   Ś	text_typeŚunicodedataŚ	normalizeŚdecodeŚencodeŚUnicodeError)Śpath© r   ś</tmp/pip-unpacked-wheel-xnf4d8iq/setuptools/unicode_utils.pyŚ	decompose   s    
r   c              	   C   s\   t | tjr| S t ” pd}|df}|D ].}z|  |”W   S  tk
rT   Y q(Y q(X q(dS )zY
    Ensure that the given path is decoded,
    NONE when no expected encoding works
    r   N)r   r   r   ŚsysŚgetfilesystemencodingr   ŚUnicodeDecodeError)r   Zfs_encŚ
candidatesŚencr   r   r   Śfilesys_decode   s    r   c                 C   s(   z|   |”W S  tk
r"   Y dS X dS )z/turn unicode encoding into a functional routineN)r	   ŚUnicodeEncodeError)Śstringr   r   r   r   Ś
try_encode'   s    r   )r   r   Zsetuptools.externr   r   r   r   r   r   r   r   Ś<module>   s
   