You are not logged in.
Pages: 1
This Base64 encoded message won't be decoded because of the LineBreak after each 76 characters!
MIIBuTCCASKgAwIBAgIQNdNhtuV5GbNHYZsf+LvM0zANBgkqhkiG9w0BAQUFADAb
MRkwFwYDVQQDExBFZGlkZXYgU21va2VUZXN0MB4XDTA4MTExMjE5NTEzNVoXDTM5
MTIzMTIzNTk1OVowGzEZMBcGA1UEAxMQRWRpZGV2IFNtb2tlVGVzdDCBnzANBgkq
hkiG9w0BAQEFAAOBjQAwgYkCgYEAm6zGzqxejwswWTNLcSsa7P8xqODspX9VQBuq
5W1RoTgQ0LNR64+7ywLjH8+wrb/lB6QV7s2SFUiWDeduVesvMJkWtZ5zzQyl3iUa
CBpT4S5AaO3/wkYQSKdI108pXH7Aue0e/ZOwgEEX1N6OaPQn7AmAB4uq1h+ffw+r
RKNHqnsCAwEAATANBgkqhkiG9w0BAQUFAAOBgQCZmj+pgRsN6HpoICawK3XXNAmi
cgfQkailX9akIjD3xSCwEQx4nG6tZjTz30u4NoSffW7pch58SxuZQDqW5NsJcQNq
Ngo/dMoqqpXdi2/0BYEcJ8pjsngrFm+fM2BnyGpXH7aWuKsWjVFGlWlF+yi8I35Q
8wFJt2Z/XGA7WWDjvw==
Please note that Base64ToBinSafe is used for decoding.
Offline
@ab - current Base64ToBin do not understand so called "transfer encoding for MIME (RFC 2045)" base64 as provided above.
We have such parser in SyNode here in SyNodeBinding_buffer.pas anyBase64ToBin
Implementation is copy-pasted from SynCommons and patched to support:
- optional padings
- RFC 2045
- 2 bytes representation of str (0xC1 0x0 0xC2 0x0 ...)
- estimate a length of result
I use it in production for many years - so implementation can be moved to SynCommons.pas
P.S
Not sure the original source is SynCommons - may be I translate this parser from Apache as noted in comments there
Last edited by mpv (2020-04-07 16:19:48)
Offline
As the new lines are encoded within the base64 string itself, I believe it must be safe to replace the breaks with nothing before decoding.
Offline
@mpv, Yes I agree with you.
My suggestion was for a workarround.
Offline
Pages: 1