]> Cypherpunks repositories - gostls13.git/commit
strings: avoid utf8.RuneError mangling in Split
authorJoe Tsai <joetsai@digital-static.net>
Thu, 23 Jun 2022 03:57:50 +0000 (20:57 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Mon, 8 Aug 2022 20:44:51 +0000 (20:44 +0000)
commit9a4685f22036b4e2577bb79dbfabd7c4e48146e3
tree835c8522189cbf231780f450fb7b9dbb7e3431dd
parentced4d6fd2d415d43c0f26e01fe332e4afa80114a
strings: avoid utf8.RuneError mangling in Split

Split should only split strings and not perform mangling
of invalid UTF-8 into ut8.RuneError.
The prior behavior is clearly a bug since mangling is not
performed in all other situations (e.g., separator is non-empty).

Fixes #53511

Change-Id: I112a2ef15ee46ddecda015ee14bca04cd76adfbf
Reviewed-on: https://go-review.googlesource.com/c/go/+/413715
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/bytes/bytes_test.go
src/strings/strings.go
src/strings/strings_test.go