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: encoding doesn't support every possible alphabet #19343

Closed
josselin-c opened this issue Mar 1, 2017 · 2 comments
Closed

encoding/base64: encoding doesn't support every possible alphabet #19343

josselin-c opened this issue Mar 1, 2017 · 2 comments
Milestone

Comments

@josselin-c
Copy link
Contributor

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

Go 1.8

What did you expect to see?

Some alphabets accepted by encoding/base64 NewEncoding cannot be decoded: alphabets containing "\n", "\r" or padChar.
See: https://play.golang.org/p/fNJfbH3QgA

Maybe NewEncoding documentation could state that we don't support theses cases or we should fix our implementation.

@ianlancetaylor ianlancetaylor added this to the Go1.9 milestone Mar 1, 2017
@ianlancetaylor
Copy link
Contributor

We could have NewEncoding check for and reject \n or \r. I don't see any way to handle padChar other than documentation, since one can call WithPadding after calling NewEncoding.

@mvdan mvdan changed the title encoding/base64: encoding doesn't support every possible alphabets encoding/base64: encoding doesn't support every possible alphabet Mar 1, 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