User Tools

Site Tools


reference:spamrules_statement_convert

Spam Filter Rules: Convert

Statement Convert
Version 2.4.9+
Purpose Allows you to convert data from one form to another

The Convert statement requires a data parameter, conversion method and variable name, in the format

Convert <data> <conversion method> <variable name>

Supported conversion methods

Name Description
Base64 Converts to Base64 encoding
DeBase64 Converts from Base64 encoding - null bytes are changed to spaces
UrlEncode Performs URL query encoding
Upper Converts to upper case
Lower Converts to lower case
Char Converts to character from ASCII code (requires v5.0 or later)
Ord Converts first character to ASCII code (requires v5.0 or later)

Examples

Storing the encoded text in a variable ${encoded} and decoding it back into a variable ${decoded}

Convert "hello" "Base64" encoded

Convert "${encoded}" "DeBase64" decoded
# ${decoded} is now "hello"

Using UrlEncode

Convert "Me & You" "UrlEncode" converted
# ${converted} is now "Me+%26+You"
reference/spamrules_statement_convert.txt · Last modified: 2018/11/14 10:45 (external edit)