go/src/unicode
Joe Tsai f371b30f32 unicode/utf8: add AppendRune
AppendRune appends the UTF-8 encoding of a rune to a []byte.
It is a generally more user friendly than EncodeRune.

    EncodeASCIIRune-4     2.35ns ± 2%
    EncodeJapaneseRune-4  4.60ns ± 2%
    AppendASCIIRune-4     0.30ns ± 3%
    AppendJapaneseRune-4  4.70ns ± 2%

The ASCII case is written to be inlineable.

Fixes #47609

Change-Id: If4f71eedffd2bd4ef0d7f960cb55b41c637eec54
Reviewed-on: https://go-review.googlesource.com/c/go/+/345571
Trust: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-08-28 01:49:50 +00:00
..
utf8 unicode/utf8: add AppendRune 2021-08-28 01:49:50 +00:00
utf16
casetables.go
digit.go
digit_test.go
example_test.go
graphic.go
graphic_test.go
letter.go unicode: correctly handle negative runes 2021-02-24 04:00:46 +00:00
letter_test.go unicode: correctly handle negative runes 2021-02-24 04:00:46 +00:00
script_test.go
tables.go unicode: upgrade to Unicode 13.0.0 2020-08-20 13:41:13 +00:00