Base64 Encoding failing

I have run base64 encoding on various scenarios for a few years and have never had any issues with base64 encoding. There are no invalid characters as the error messages indicate. Any thoughts, please?

Thank you in advance

1 Like

can you show the error message. Try to encode the string with an online base64 encoder and see if it encodes out there.

I have tried it with various base64 encode tools & it works perfectly on those. This is the error:

You could try to put the string in notepad++ or some text editor that could see hidden chars and see if it has any hidden chars are int he string.
Is this affecting all the strings you are trying to encode or is it only this string that is affected ?

1 Like

Thanks for that suggestion - I did that and found no hidden characters.
Some strings are being encoded correctly and some are not. Ive compared them side by side & don’t see any material differences (apart from different data of course) but both the successful & the failed strings contain the same characters. Ive spent a lot of hours on this. I have to resolve this asap - Thanks for assiting

Could you put on here a successful string and the string that failed?

1 Like

We have the same issues.
Our temporary workaround is to use an already base64 encoded string (we encode it somewhere else), then our scenario works fine.
But this is far from ideal.

An example of a character that is failing in the encoding is : ≥ .

Thanks for taking a look at this!

You will need to use the function encodeURL first, then do the base64 encoding.

1 Like