We have a requirement where we are encrypting Salesforce ID value using Crypto class method.
Crypto.encryptWithManagedIV('AES128', key, data);
But it generates a key which contains
+ sign and when we read this value in apex we get space for that
EncodingUtil.urlEncode. In that case
+ sign is getting converted into
%2B and again we get space for that in the apex.
For Ex - Encoded value in URL:
Encoded value in Apex:
Can someone please suggest how to handle the situation?
We can handle spaces by replacing it with
+ sign. But I am not sure if it will throw an error for any specific characters/case.