Base64Decode

概要 

Base64 情報を人間が読み取り可能なテキストに復号化します。

構文 

Base64Decode(1, 2, 3)

関数のプロパティ 

序数説明
1string必須Lookup() AMPscript 関数を介した変数またはデータエクステンションフィールド内の Base64 テキストの場所
2string復号化処理に使用する .NET でサポートされる文字種別 (UTF-8 または UTF-16 など)
3int誤ってコード化された Base64 テキストのメール送信を続行するかどうかを示します。0 の値は、送信でエラーが発生した場合に送信を続行できます。1 の値は、送信でエラーが発生した場合に送信を続行できません。デフォルト値は 1 です。

使用状況 

1%%[
2VAR @encodedStr, @decodedStr
3SET @encodedStr = Lookup('Base64Info', 'ReceiptData', 'ReceiptKey', 1)
4SET @decodedStr = Base64Decode(@encodedStr,'UTF-8')
5]%%
6The Lookup() function retrieves the Base64 information from the data extension, and the Base64Decode() decodes the Base64 information and assigns that value to the @decodedStr variable in UTF-8 format. If for some reason the value of @encodedStr is incorrect, the 1 at the end of the Base64Decode() function causes the send to fail due to the error.
7%%[
8VAR @encodedStr, @decodedStr
9SET @encodedStr = Lookup('Base64Info', 'ReceiptData', 'ReceiptKey', 0)
10SET @decodedStr = Base64Decode(@encodedStr,'UTF-8', 1)
11]%%

値が 0 の場合は送信が続行され、メールには復号化されたデータの代わりに空の文字列が含まれます。