go/src/bytes
Martin Möhrmann 3259bc4419 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>
2019-05-01 18:31:47 +00:00
..
boundary_test.go
buffer.go bytes: hoist error creation out of function 2019-02-26 22:57:25 +00:00
buffer_test.go bytes: clean up a test 2019-02-26 23:16:46 +00:00
bytes.go strings, bytes: add ToValidUTF8 2019-05-01 18:31:47 +00:00
bytes_test.go strings, bytes: add ToValidUTF8 2019-05-01 18:31:47 +00:00
compare_test.go bytes: vary the input alignment to Compare argument in compare_test.go 2018-10-11 04:45:18 +00:00
example_test.go bytes: add examples for ToTitleSpecial, ToUpperSpecial and ToLowerSpecial 2019-03-01 14:56:41 +00:00
export_test.go bytes, internal/bytealg: simplify Equal 2019-04-24 00:56:36 +00:00
reader.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
reader_test.go bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00