Ë
    òmxi9  ã                   ó˜   — d Z dZdZg ZdZdZddlZg d¢Zd„ Z	d	„ Z
ed
k(  r+ddlZ G d„ dej                  «      Z ej                  «        yy)zConverts an IRI to a URI.z!Joe Gregorio (joe@bitworking.org)zCopyright 2006, Joe Gregorioz1.0.0ÚMITé    N))é    iÿ×  )i à  iÿø  )i ù  iÏý  )iðý  iïÿ  )i   iýÿ )i   iýÿ )i   iýÿ )i   iýÿ )i   iýÿ )i   iýÿ )i   iýÿ )i   iýÿ )i  	 iýÿ	 )i  
 iýÿ
 )i   iýÿ )i   iýÿ )i   iýÿ )i  iýÿ )i   iýÿ )i   iýÿ c                 óÔ   — | }t        | «      }t        D ]L  \  }}||k  r |S ||k\  sŒ||k  sŒdj                  | j                  d«      D �cg c]  }d|z  ‘Œ	 c}«      } |S  |S c c}w )NÚ úutf-8z%%%2X)ÚordÚescape_rangeÚjoinÚencode)ÚcÚretvalÚiÚlowÚhighÚos         úG/home/htdocs/ttos/venv/lib/python3.12/site-packages/httplib2/iri2uri.pyr   r   0   s~   € Ø€FÜˆA‹€AÜ!ò ‰	ˆˆTØˆsŠ7Øð €Mð �‹8˜˜T›	Ø—W‘W°1·8±8¸GÓ3DÖE¨a˜g¨›kÒEÓFˆFØØ€Mðð €Mùò Fs   ÁA%
c                 óR  — t        | t        «      r‘t        j                  j	                  | «      \  }}}}}|j                  d«      j                  d«      }t        j                  j                  |||||f«      } dj                  | D �cg c]  }t        |«      ‘Œ c}«      } | S c c}w )zžConvert an IRI to a URI. Note that IRIs must be
    passed in a unicode strings. That is, do not utf-8 encode
    the IRI before passing it into the function.Úidnar   r   )	Ú
isinstanceÚstrÚurllibÚparseÚurlsplitr   ÚdecodeÚ
urlunsplitr
   )ÚuriÚschemeÚ	authorityÚpathÚqueryÚfragmentr   s          r   Úiri2urir"   <   s�   € ô �#”sÔÜ5;·\±\×5JÑ5JÈ3Ó5OÑ2ˆ�˜D %¨Ø×$Ñ$ VÓ,×3Ñ3°GÓ<ˆ	ô �l‰l×%Ñ% v¨y¸$ÀÀxÐ&PÓQˆØ�g‰g¨#Ö. Q”v˜a•yÒ.Ó/ˆØ€Jùò /s   Â	B$Ú__main__c                   ó   — e Zd Zd„ Zd„ Zy)ÚTestc                 óP   — g d¢}|D ]  }| j                  |t        |«      «       Œ y)z6Test that URIs are invariant under the transformation.)z"ftp://ftp.is.co.za/rfc/rfc1808.txtz#http://www.ietf.org/rfc/rfc2396.txtz)ldap://[2001:db8::7]/c=GB?objectClass?onezmailto:John.Doe@example.comz&news:comp.infosystems.www.servers.unixztel:+1-816-555-1212ztelnet://192.0.2.16:80/z3urn:oasis:names:specification:docbook:dtd:xml:4.1.2N)ÚassertEqualr"   )ÚselfÚ	invariantr   s      r   Ú	test_uriszTest.test_urisO   s.   € ò	ˆIð !ò 4�Ø× Ñ  ¤g¨c£lÕ3ñ4ó    c                 ó®  — | j                  dt        d«      «       | j                  dt        d«      «       | j                  dt        d«      «       | j                  dt        d«      «       | j                  d	t        d
«      «       | j                  d	t        t        d
«      «      «       | j                  d	t        d
j                  d«      «      «       y)zFTest that the right type of escaping is done for each part of the URI.zhttp://xn--o3h.com/%E2%98%84u   http://â˜„.com/â˜„z%http://bitworking.org/?fred=%E2%98%84u   http://bitworking.org/?fred=â˜„z http://bitworking.org/#%E2%98%84u   http://bitworking.org/#â˜„z
#%E2%98%84u   #â˜„z/fred?bar=%E2%98%9A#%E2%98%84u   /fred?bar=â˜š#â˜„r   N)r'   r"   ÚassertNotEqualr   )r(   s    r   Útest_irizTest.test_iri^   sÏ   € à×ÑØ.ÜÐ8Ó9ôð ×ÑØ7ÜÐ?Ó@ôð ×ÑØ2ÜÐ:Ó;ôð ×Ñ˜\¬7°<Ó+@ÔAØ×ÑØ/ÜÐKÓLôð ×ÑØ/ÜœÐ SÓTÓUôð ×ÑØ/ÜØG×NÑNÈwÓWóõr+   N)Ú__name__Ú
__module__Ú__qualname__r*   r.   © r+   r   r%   r%   N   s   „ ò	4ó	r+   r%   )Ú__doc__Ú
__author__Ú__copyright__Ú__contributors__Ú__version__Ú__license__Úurllib.parser   r	   r   r"   r/   ÚunittestÚTestCaser%   Úmainr2   r+   r   ú<module>r=      si   ðá à0€
Ø.€ØÐ Ø€Ø€ã ò€ò0	òð ˆzÒÛô,ˆx× Ñ ô ,ð\ €H‡M�M…Oðc r+   