summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/text/secure/precis/nickname.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/text/secure/precis/nickname.go')
-rw-r--r--vendor/golang.org/x/text/secure/precis/nickname.go28
1 files changed, 15 insertions, 13 deletions
diff --git a/vendor/golang.org/x/text/secure/precis/nickname.go b/vendor/golang.org/x/text/secure/precis/nickname.go
index cd54b9e69..11e0ccbb1 100644
--- a/vendor/golang.org/x/text/secure/precis/nickname.go
+++ b/vendor/golang.org/x/text/secure/precis/nickname.go
@@ -23,24 +23,26 @@ func (t *nickAdditionalMapping) Reset() {
}
func (t *nickAdditionalMapping) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
- // RFC 7700 §2.1. Rules
+ // RFC 8266 §2.1. Rules
//
// 2. Additional Mapping Rule: The additional mapping rule consists of
- // the following sub-rules.
+ // the following sub-rules.
//
- // 1. Any instances of non-ASCII space MUST be mapped to ASCII
- // space (U+0020); a non-ASCII space is any Unicode code point
- // having a general category of "Zs", naturally with the
- // exception of U+0020.
+ // a. Map any instances of non-ASCII space to SPACE (U+0020); a
+ // non-ASCII space is any Unicode code point having a general
+ // category of "Zs", naturally with the exception of SPACE
+ // (U+0020). (The inclusion of only ASCII space prevents
+ // confusion with various non-ASCII space code points, many of
+ // which are difficult to reproduce across different input
+ // methods.)
//
- // 2. Any instances of the ASCII space character at the beginning
- // or end of a nickname MUST be removed (e.g., "stpeter " is
- // mapped to "stpeter").
+ // b. Remove any instances of the ASCII space character at the
+ // beginning or end of a nickname (e.g., "stpeter " is mapped to
+ // "stpeter").
//
- // 3. Interior sequences of more than one ASCII space character
- // MUST be mapped to a single ASCII space character (e.g.,
- // "St Peter" is mapped to "St Peter").
-
+ // c. Map interior sequences of more than one ASCII space character
+ // to a single ASCII space character (e.g., "St Peter" is
+ // mapped to "St Peter").
for nSrc < len(src) {
r, size := utf8.DecodeRune(src[nSrc:])
if size == 0 { // Incomplete UTF-8 encoding