name-codecs.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .. _name-codecs:
  2. International Domain Name CODECs
  3. --------------------------------
  4. Representing non-ASCII text in the DNS is a complex and evolving
  5. topic. Generally speaking, Unicode is converted into an ASCII-only,
  6. case-insensitive form called "Punycode" by complex rules. There are
  7. two standard specifications for this process, "IDNA 2003", which is
  8. widely used, and the revised and not fully compatible standard "IDNA
  9. 2008". There are also varying degrees of strictness that can be applied
  10. in encoding and decoding. Explaining the standards in detail is
  11. out of scope for this document; Unicode Technical Standard #46
  12. http://unicode.org/reports/tr46/ is a good place to start learning more.
  13. Dnspython provides "codecs" to implement International Domain Name policy
  14. according to the user's desire.
  15. .. autoclass:: dns.name.IDNACodec
  16. :members:
  17. .. autoclass:: dns.name.IDNA2003Codec
  18. :members:
  19. .. autoclass:: dns.name.IDNA2008Codec
  20. :members:
  21. .. data:: dns.name.IDNA_2003_Practical
  22. The "practical" codec encodes using IDNA 2003 rules and decodes
  23. punycode without checking for strict IDNA 2003 compliance.
  24. .. data:: dns.name.IDNA_2003_Strict
  25. The "strict" codec encodes using IDNA 2003 rules and decodes
  26. punycode checking for IDNA 2003 compliance.
  27. .. data:: dns.name.IDNA_2003
  28. A synonym for ``dns.name.IDNA_2003_Practical``.
  29. .. data:: dns.name.IDNA_2008_Practical
  30. The "practical" codec encodes using IDNA 2008 rules with UTS 46
  31. compatibility processing, and allowing pure ASCII labels. It
  32. decodes punycode without checking for strict IDNA 2008 compliance.
  33. .. data:: dns.name.IDNA_2008_Strict
  34. The "strict" codec encodes using IDNA 2008 rules and decodes
  35. punycode checking for IDNA 2008 compliance.
  36. .. data:: dns.name.IDNA_2008_UTS_46
  37. The "UTS 46" codec encodes using IDNA 2008 rules with UTS 46
  38. compatibility processing and decodes punycode without checking for
  39. IDNA 2008 compliance.
  40. .. data:: dns.name.IDNA_2008_Transitional
  41. The "UTS 46" codec encodes using IDNA 2008 rules with UTS 46
  42. compatibility processing in the "transitional mode" and decodes
  43. punycode without checking for IDNA 2008 compliance.
  44. .. data:: dns.name.IDNA_2008
  45. A synonym for ``dns.name.IDNA_2008_Practical``.