add comment in xmpp_stringprep

This commit is contained in:
Yann Leboulanger 2005-11-23 18:36:07 +00:00
parent 004c2b546e
commit 767dc426ed
1 changed files with 18 additions and 3 deletions

View File

@ -162,9 +162,24 @@ class Profile:
class NamePrep:
""" Implements nameprep on international domain names.
STD3ASCIIRules is assumed true in this implementation.
""" Implements preparation of internationalized domain names.
This class implements preparing internationalized domain names using the
rules defined in RFC 3491, section 4 (Conversion operations).
We do not perform step 4 since we deal with unicode representations of
domain names and do not convert from or to ASCII representations using
punycode encoding. When such a conversion is needed, the L{idna} standard
library provides the C{ToUnicode()} and C{ToASCII()} functions. Note that
L{idna} itself assumes UseSTD3ASCIIRules to be false.
The following steps are performed by C{prepare()}:
* Split the domain name in labels at the dots (RFC 3490, 3.1)
* Apply nameprep proper on each label (RFC 3491)
* Enforce the restrictions on ASCII characters in host names by
assuming STD3ASCIIRules to be true. (STD 3)
* Rejoin the labels using the label separator U+002E (full stop).
"""
# Prohibited characters.