Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/base64: document that padchar cannot be multi-byte #19318

Closed
josselin-c opened this issue Feb 28, 2017 · 1 comment
Closed

encoding/base64: document that padchar cannot be multi-byte #19318

josselin-c opened this issue Feb 28, 2017 · 1 comment

Comments

@josselin-c
Copy link
Contributor

What version of Go are you using (go version)?

Go 1.8

What did you expect to see?

Looking at encoding/base64 we see that WithPadding accepts a rune:
https://golang.org/pkg/encoding/base64/#Encoding.WithPadding

Looking at the current implementation, the padding character can not be a multi-byte rune as the code compare bytes with padChar:

if rune(in) == enc.padChar {

What did you see instead?

I would like the documentation to be changed so it's explicit that we don't support multi-byte padding characters as I don't think it makes sense.

@josselin-c josselin-c changed the title encoding/base64: document if padchar can be > RuneSelf encoding/base64: document if padchar can multi-byte Feb 28, 2017
@josselin-c josselin-c changed the title encoding/base64: document if padchar can multi-byte encoding/base64: document that padchar cannot be multi-byte Feb 28, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.9 milestone Feb 28, 2017
@gopherbot
Copy link

CL https://golang.org/cl/37838 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants