You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do not currently support newline characters in base64 strings. The spec technically allows for newline characters but does not require implementations to support those. It specifically states that that's a a decision of the implementation: https://datatracker.ietf.org/doc/html/rfc4648#section-3.3
Hence, this is not a bug and instead a matter of choice. A lot of implementations ignore \n and \r\n though so maybe we should do too.
In order to fix your problem here you can just do this for now:
What version of Effect is running?
3.7.0
What steps can reproduce the bug?
Outputs:
As you can see, Deno's standard library implementation correctly returns, where the
effect/Encoding
doesn't.What is the expected behavior?
Expected to decode the string correctly.
What do you see instead?
left: {
_tag: 'DecodeException',
input: 'bmFtZTogYmVuY2gKCm9uOgogIHB1bGxfcmVxdWVzdDoKICAgIGJyYW5jaGVz\n' +
'OgogICAgICAtIG1haW4KICBwdXNoOgogICAgYnJhbmNoZXM6CiAgICAgIC0g\n' +
'bWFpbgoKam9iczoKICBsaW50OgogICAgcnVucy1vbjogdWJ1bnR1LWxhdGVz\n' +
'dAoKICAgIHN0ZXBzOgogICAgICAtIHVzZXM6IGFjdGlvbnMvY2hlY2tvdXRA\n' +
'djMKICAgICAgLSB1c2VzOiBkZW5vbGFuZC9zZXR1cC1kZW5vQHYxCiAgICAg\n' +
'ICAgd2l0aDoKICAgICAgICAgIGRlbm8tdmVyc2lvbjogdjEueAogICAgICAg\n' +
'ICAgCiAgICAgIC0gbmFtZTog8J+PhyBSdW4gYmVuY2htYXJrcwogICAgICAg\n' +
'IHJ1bjogZGVubyB0YXNrIGJlbmNoCg==',
message: 'Length must be a multiple of 4, but is 459',
[Symbol(effect/Encoding/errors/Decode)]: Symbol(effect/Encoding/errors/Decode)
}
Additional information
No response
The text was updated successfully, but these errors were encountered: