Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Base64 Conversion using Javascript does not work as expected

We are trying to convert a PDF file into Base64 string using Javascript within Apigee Edge Cloud. But when we try to decode the Base64 string back to PDF, we are not getting back the original PDF text. This is because the Base64 conversion does not seem to work correctly within Apigee. The Base64 string obtained within Apigee is not matching with some standard Base64 tools such as http://www.base64encode.org

1. I have been able to reproduce this problem with a simple API proxy using the same Base64 Encoding algorithm.

2. When I just try to do Base64 encoding of "\n", I get the value shown below from from within Apigee

Cg==

3. However, when I try to do Base64 encoding of "\n" using the standard Base64 encoder http://www.base64encode.org, I get the following output:

XG4=

Can someone help in fixing this issue ?

0 6 2,691
6 REPLIES 6