@@ -1236,15 +1236,21 @@ the user: The application should transparently convert Unicode domain labels to
12361236IDNA on the wire, and convert back ACE labels to Unicode before presenting them
12371237to the user.
12381238
1239- Python supports this conversion in several ways: The ``idna `` codec allows to
1240- convert between Unicode and the ACE. Furthermore, the :mod: `socket ` module
1239+ Python supports this conversion in several ways: the ``idna `` codec performs
1240+ conversion between Unicode and ACE, separating an input string into labels
1241+ based on the separator characters defined in `section 3.1 `_ (1) of :rfc: `3490 `
1242+ and converting each label to ACE as required, and conversely separating an input
1243+ byte string into labels based on the ``. `` separator and converting any ACE
1244+ labels found into unicode. Furthermore, the :mod: `socket ` module
12411245transparently converts Unicode host names to ACE, so that applications need not
12421246be concerned about converting host names themselves when they pass them to the
12431247socket module. On top of that, modules that have host names as function
12441248parameters, such as :mod: `http.client ` and :mod: `ftplib `, accept Unicode host
12451249names (:mod: `http.client ` then also transparently sends an IDNA hostname in the
12461250:mailheader: `Host ` field if it sends that field at all).
12471251
1252+ .. _section 3.1 : http://tools.ietf.org/html/rfc3490#section-3.1
1253+
12481254When receiving host names from the wire (such as in reverse name lookup), no
12491255automatic conversion to Unicode is performed: Applications wishing to present
12501256such host names to the user should decode them to Unicode.
0 commit comments