]> Cypherpunks repositories - gostls13.git/commit
strings, bytes: add ToValidUTF8
authorMartin Möhrmann <moehrmann@google.com>
Sat, 13 Oct 2018 20:40:23 +0000 (22:40 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 May 2019 18:31:47 +0000 (18:31 +0000)
commit3259bc441957bf74f069cf7df961367a3472afb2
tree893219a535c83700f7bcc9df6b7e3ad43764a45c
parent07f689420a552841270c6b751b0a890f6d27cd30
strings, bytes: add ToValidUTF8

The newly added functions create a copy of their input with all bytes in
invalid UTF-8 byte sequences mapped to the UTF-8 byte sequence
given as replacement parameter.

Fixes #25805

Change-Id: Iaf65f65b40c0581c6bb000f1590408d6628321d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/142003
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/bytes/bytes.go
src/bytes/bytes_test.go
src/strings/strings.go
src/strings/strings_test.go