@@ -1185,15 +1185,21 @@ the user: The application should transparently convert Unicode domain labels to
11851185IDNA on the wire, and convert back ACE labels to Unicode before presenting them
11861186to the user.
11871187
1188- Python supports this conversion in several ways: The ``idna `` codec allows to
1189- convert between Unicode and the ACE. Furthermore, the :mod: `socket ` module
1188+ Python supports this conversion in several ways: the ``idna `` codec performs
1189+ conversion between Unicode and ACE, separating an input string into labels
1190+ based on the separator characters defined in `section 3.1 `_ (1) of :rfc: `3490 `
1191+ and converting each label to ACE as required, and conversely separating an input
1192+ byte string into labels based on the ``. `` separator and converting any ACE
1193+ labels found into unicode. Furthermore, the :mod: `socket ` module
11901194transparently converts Unicode host names to ACE, so that applications need not
11911195be concerned about converting host names themselves when they pass them to the
11921196socket module. On top of that, modules that have host names as function
11931197parameters, such as :mod: `http.client ` and :mod: `ftplib `, accept Unicode host
11941198names (:mod: `http.client ` then also transparently sends an IDNA hostname in the
11951199:mailheader: `Host ` field if it sends that field at all).
11961200
1201+ .. _section 3.1 : http://tools.ietf.org/html/rfc3490#section-3.1
1202+
11971203When receiving host names from the wire (such as in reverse name lookup), no
11981204automatic conversion to Unicode is performed: Applications wishing to present
11991205such host names to the user should decode them to Unicode.
0 commit comments