mò
­fIc           @   sÁ   d  k  Z  d  k Z d  k Z d  k Z e i d ƒ Z d Z e e d ƒ Z d „  Z	 d „  Z
 d „  Z d e i f d „  ƒ  YZ d	 e e i f d
 „  ƒ  YZ d e e i f d „  ƒ  YZ d „  Z d  S(   Nu   [.ã€‚ï¼Žï½¡]s   xn--t   asciic         C   s”  g  } x; |  D]3 } t i | ƒ o q n | i t i | ƒ ƒ q Wd i | ƒ }  t i	 d |  ƒ }  xµ |  D]­ } t i
 | ƒ p€ t i | ƒ pp t i | ƒ p` t i | ƒ pP t i | ƒ p@ t i | ƒ p0 t i | ƒ p  t i | ƒ p t i | ƒ o t d t | ƒ ‚ ql ql Wt t i |  ƒ } x^ | D]V } | oI t t i |  ƒ o t d ‚ n | d p | d o t d ‚ qŒq6q6W|  S(   Nu    t   NFKCs   Invalid character %ss   Violation of BIDI requirement 2i    iÿÿÿÿs   Violation of BIDI requirement 3(   t   newlabelt   labelt   ct
   stringprept   in_table_b1t   appendt   map_table_b2t   joint   unicodedatat	   normalizet   in_table_c12t   in_table_c22t   in_table_c3t   in_table_c4t   in_table_c5t   in_table_c6t   in_table_c7t   in_table_c8t   in_table_c9t   UnicodeErrort   reprt   mapt   in_table_d1t   RandALt   filtert   in_table_d2(   R   R   R   R   (    (    t+   /mit/python/lib/python2.4/encodings/idna.pyt   nameprep   s*      	 c         C   s7  y |  i d ƒ }  Wn t j
 o n7 Xd t |  ƒ j  o
 d j  n o |  Sn t d ‚ t |  ƒ }  y |  i d ƒ }  Wn t j
 o n7 Xd t |  ƒ j  o
 d j  n o |  Sn t d ‚ |  i t ƒ o t d ‚ n |  i d ƒ }  t |  }  d t |  ƒ j  o
 d j  n o |  Sn t d ‚ d  S(   NR    i    i@   s   label too longs   Label starts with ACE prefixt   punycode(   R   t   encodeR   t   lenR   t
   startswitht   uace_prefixt
   ace_prefix(   R   (    (    R   t   ToASCII=   s,    $	$	
$c         C   s  t  |  t ƒ o
 t } n6 y |  i d ƒ }  t } Wn t j
 o t } n X| pB t |  ƒ }  y |  i d ƒ }  Wq˜ t j
 o t d ‚ q˜ Xn |  i	 t
 ƒ p t |  d ƒ Sn |  t t
 ƒ } | i d ƒ } t | ƒ } |  i ƒ  | j o t d |  | f ‚ n | S(   NR    s   Invalid character in IDN labelR   s   IDNA does not round-trip(   t
   isinstanceR   t   strt   Truet
   pure_asciiR   R   t   FalseR   R!   R#   t   unicodeR    t   label1t   decodet   resultR$   t   label2t   lower(   R   R(   R+   R.   R-   (    (    R   t	   ToUnicodeh   s*    

t   Codecc           B   s    t  Z d d „ Z d d „ Z RS(   Nt   strictc         C   s¸   | d j o t d | ‚ n | p d Sn g  } t i | ƒ } | o( t | d ƒ d j o d } | d =n d } x! | D] } | i
 t | ƒ ƒ q~ Wd i | ƒ | t | ƒ f S(   NR2   s   unsupported error handling t    i    iÿÿÿÿt   .(   R3   i    (   t   errorsR   t   inputR-   t   dotst   splitt   labelsR    t   trailing_dotR   R   R$   R	   (   t   selfR6   R5   R:   R9   R   R-   (    (    R   R   ’   s     c         C   sô   | d j o t d | ‚ n | p d	 Sn t | t ƒ o t i | ƒ } n) t | ƒ } t | d ƒ | i d ƒ } | o( t	 | d ƒ d j o d } | d =n d } g  } x! | D] } | i t | ƒ ƒ qº Wd i | ƒ | t	 | ƒ f S(
   NR2   s   Unsupported error handling u    i    R    R4   iÿÿÿÿu   .(   u    i    (   R5   R   R6   R%   R*   R7   R8   R9   R&   R    R:   R-   R   R   R0   R	   (   R;   R6   R5   R:   R9   R   R-   (    (    R   R,   §   s$     (   t   __name__t
   __module__R   R,   (    (    (    R   R1   ‘   s   t   StreamWriterc           B   s   t  Z RS(   N(   R<   R=   (    (    (    R   R>   Ä   s   t   StreamReaderc           B   s   t  Z RS(   N(   R<   R=   (    (    (    R   R?   Ç   s   c           C   s   t  ƒ  i t  ƒ  i t t f S(   N(   R1   R   R,   R?   R>   (    (    (    R   t   getregentryÌ   s    (   R   R
   t   ret   codecst   compileR7   R#   R*   R"   R   R$   R0   R1   R>   R?   R@   (   R7   R>   R
   R1   R#   R   RA   R$   R   R0   RB   R@   R"   R?   (    (    R   t   ?   s   $	0	+	)3