]> Cypherpunks repositories - gostls13.git/commit
encoding: document that base32 and base64 do not use UTF-8
authorJoe Tsai <joetsai@digital-static.net>
Thu, 22 Jun 2023 18:10:18 +0000 (11:10 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Tue, 27 Jun 2023 17:27:30 +0000 (17:27 +0000)
commit4f36f7e4dd921be455810cc925ca122d71381156
tree85418a7a59baeb15042b2e9b61bb1526677d9e0b
parent8008c0840ff09c492434e67de443ee478957fb8f
encoding: document that base32 and base64 do not use UTF-8

The invention of base32 and base64 predates the invention of UTF-8
and was never meant to output valid UTF-8.
By default, the output is always valid ASCII (and thus valid UTF-8)
except when the user specifies an alphabet or padding value
that is larger than '\x7f'. If that is done,
then the exact byte symbol is used rather than the UTF-8 encoding.

Fixes #60689

Change-Id: I4ec88d974ec0658ad1a578bbd65a809e27c73ea7
Reviewed-on: https://go-review.googlesource.com/c/go/+/505237
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/encoding/base32/base32.go
src/encoding/base64/base64.go