textdecodebase64 Function
textdecodebase64 function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.
textdecodebase64(string, encoding_name)
OpenTofu uses the "standard" Base64 alphabet as defined in RFC 4648 section 4.
The encoding_name argument must contain one of the encoding names or aliases recorded in the IANA character encoding registry. OpenTofu supports only a subset of the registered encodings, and the encoding support may vary between OpenTofu versions.
OpenTofu accepts the encoding name UTF-8, which will produce the same result as base64decode.
Examples
> textdecodebase64("SABlAGwAbABvACAAVwBvAHIAbABkAA==", "UTF-16LE")
Hello WorldRelated Functions
-
textencodebase64performs the opposite operation, applying target encoding and then Base64 to a string. -
base64decodeis effectively a shorthand fortextdecodebase64where the character encoding is fixed asUTF-8.
Copyright (c) The OpenTofu Authors
Copyright (c) 2014 HashiCorp, Inc.
Mozilla Public License, version 2.0
https://opentofu.org/docs/v1.9/language/functions/textdecodebase64/