
    hV                    X    S SK Jr  S SKJr   S       SS jjr S       SS jjrg)	    )annotations)
StrOrBytesNc                    [        U [        5      (       a  U $ [        U [        [        45      (       d!  [        S[	        U 5      R
                   35      eUc  SnU R                  X5      $ )ztReturn the unicode representation of a bytes object `text`. If `text`
is already an unicode object, return it as-is.z*to_unicode must receive bytes or str, got utf-8)
isinstancestrbytes	TypeErrortype__name__decodetextencodingerrorss      Q/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/w3lib/util.py
to_unicoder      se    
 $dUCL))8d9L9L8MN
 	
 ;;x((    c                    [        U [        5      (       a  U $ [        U [        5      (       d!  [        S[	        U 5      R
                   35      eUc  SnU R                  X5      $ )zaReturn the binary representation of `text`. If `text`
is already a bytes object, return it as-is.z(to_bytes must receive str or bytes, got r   )r   r	   r   r
   r   r   encoder   s      r   to_bytesr      sa    
 $dC  6tDz7J7J6KL
 	
 ;;x((r   )Nstrict)r   r   r   
str | Noner   r   returnr   )r   r   r   r   r   r   r   r	   )
__future__r   w3lib._typesr   r   r    r   r   <module>r      sc    " # BJ)
) *);>))" BJ)
) *);>)
)r   