Convert Base64 to Text
Verb: base64ToText
Converts Base64 format content to text.
Base64 encoding is a process for converting binary data to an ASCII string format. The binary data is converted into a 6-bit character representation.
Syntax
base64ToText --source(String) --encoding(Nullable<EncodingType>) (Boolean)=success (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--source | Base64 | Required | Text | Base64 content that should be converted to text. |
--encoding | Encoding | Required | EncodingType | Type of encoding used to convert Base64 content to text. Options:
|
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
success | Success | Boolean | Returns "True" if the conversion was successful, or "False" if it was not. |
value | Text | Text | Base 64 content inserted in the Base64 parameter, now converted to Text. |
Example
Converts base64 content to text. This content was inserted in the Base64 parameter, with the same encoding type as Convert Text to Base64, which was used to create the content in this format.
defVar --name conversionSuccess --type Boolean
defVar --name base64Content --type String
defVar --name convertedContent --type String --value "This is a text that is encoded to base64 and then converted to text again."
textToBase64 --source "${convertedContent}" --encoding "UTF8" base64Content=value
logMessage --message "Base64 content: ${base64Content}\r\n" --type "Info"
base64ToText --source "${base64Content}" --encoding "UTF8" convertedContent=value conversionSuccess=success
logMessage --message "Converted Content: ${convertedContent}\r\nSuccess: ${conversionSuccess}\r\n\r\n" --type "Info"
// Result: True
// This is a text that is encoded to base64 and then converted to text again.
Remarks
For best conversion results, it is recommended to use the same encoding on the Encoding parameter as the one used to create the base64 content with the Convert Text to Base64 command.