跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

textdecodebase64 Function ​

Encodes the input string from a speicified encoding into UTF-8. The input is base64-encoded to account for HCL's string encoding limitations: they must be UTF-8, NFC-normalised.

Packer 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.

Examples ​

shellsession
# Usage: textencodebase64(input_base64, encoding_name)
> textdecodebase64("SABlAGwAbABvACAAVwBvAHIAbABkAA==", "UTF-16LE")
Hello World
  • base64encode performs the opposite operation, encoding the UTF-8 bytes for a string as Base64.

基于 MPL-2.0 许可证发布。