dns :: name :: IDNA2008Codec :: Class IDNA2008Codec
[hide private]
[frames] | no frames]

Class IDNA2008Codec

source code

object --+    
         |    
 IDNACodec --+
             |
            IDNA2008Codec

IDNA 2008 encoder/decoder.

Instance Methods [hide private]
 
__init__(self, uts_46=False, transitional=False, allow_pure_ascii=False, strict_decode=False)
Initialize the IDNA 2008 encoder/decoder.
source code
 
is_all_ascii(self, label) source code
 
encode(self, label) source code
 
decode(self, label) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, uts_46=False, transitional=False, allow_pure_ascii=False, strict_decode=False)
(Constructor)

source code 

Initialize the IDNA 2008 encoder/decoder.

Parameters:
  • uts_46 (bool) - If True, apply Unicode IDNA compatibility processing as described in Unicode Technical Standard #46 (http://unicode.org/reports/tr46/). This parameter is only meaningful if IDNA 2008 is in use. If False, do not apply the mapping. The default is False
  • transitional (bool) - If True, use the "transitional" mode described in Unicode Technical Standard #46. This parameter is only meaningful if IDNA 2008 is in use. The default is False.
  • allow_pure_ascii (bool) - If True, then a label which consists of only ASCII characters is allowed. This is less strict than regular IDNA 2008, but is also necessary for mixed names, e.g. a name with starting with "_sip._tcp." and ending in an IDN suffixm which would otherwise be disallowed. The default is False
  • strict_decode (bool) - If True, then IDNA2008 checking is done when decoding. This can cause failures if the name was encoded with IDNA2003. The default is False.
Overrides: object.__init__

encode(self, label)

source code 
Overrides: IDNACodec.encode

decode(self, label)

source code 
Overrides: IDNACodec.decode