aboutsummaryrefslogtreecommitdiff
path: root/src/unicode/utf8/utf8.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/unicode/utf8/utf8.go')
-rw-r--r--src/unicode/utf8/utf8.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/unicode/utf8/utf8.go b/src/unicode/utf8/utf8.go
index ef0d740960..557e8a7770 100644
--- a/src/unicode/utf8/utf8.go
+++ b/src/unicode/utf8/utf8.go
@@ -337,6 +337,7 @@ func RuneLen(r rune) int {
}
// EncodeRune writes into p (which must be large enough) the UTF-8 encoding of the rune.
+// If the rune is out of range, it writes the encoding of RuneError.
// It returns the number of bytes written.
func EncodeRune(p []byte, r rune) int {
// Negative values are erroneous. Making it unsigned addresses the problem.