Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Base64Encode and Base64Decode are not inverse functions

SA-78788

Summary



The @Base64Decode(@Base64Encode(param.inputStr)) returns null for a string in the attachment.


Error Messages



Not Applicable


Steps to Reproduce

  1. Use the attached document to obtain the string.
  2. Execute a  simple activity with Encode-Decode.


Root Cause



A defect in Pegasystems’ code or rules: Pega's Base64 API.


Resolution



Perform the folloiwng local-change:

Use java.util.Base64 library in the Rule Utility Functions (RUF) instead of Pega's Base64.

For Encoding - new String(java.util.Base64.getEncoder().encode(nonFormatted.getBytes()))
For Decoding - new String(java.util.Base64.getDecoder().decode(encodedString.getBytes()))

 

Suggest Edit

Published December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us