]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.10] strings: fix encoding of \u0080 in map
authorMartin Möhrmann <moehrmann@google.com>
Fri, 4 May 2018 04:54:18 +0000 (06:54 +0200)
committerAndrew Bonventre <andybons@golang.org>
Sat, 26 May 2018 22:49:02 +0000 (22:49 +0000)
commit2bded9dc19a65005fbcb37ab1e51a9237998b09e
tree51ec333bbd5f278d89a866017b9460bfde274520
parent48ee689f19c0b27c8a7b2de9d3b26fe6c0d4fa5d
[release-branch.go1.10] strings: fix encoding of \u0080 in map

Fix encoding of PAD (U+0080) which has the same value as utf8.RuneSelf
being incorrectly encoded as \x80 in strings.Map due to using <= instead
of a < comparison operator to check one byte encodings for utf8.

Fixes golang/go#25479

Change-Id: Ib6c7d1f425a7ba81e431b6d64009e713d94ea3bc
Reviewed-on: https://go-review.googlesource.com/111286
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 8c62fc0ca3c96ecbd3a6e81546aa8c53e32ff500)
Reviewed-on: https://go-review.googlesource.com/114635
Run-TryBot: Andrew Bonventre <andybons@golang.org>
src/strings/strings.go
src/strings/strings_test.go