Qore Mime Module Reference  1.4.4
MIME Decoding Functions

Functions

binary Mime::mime_decode_base64 (data str)
 returns a binary value from a string in "BASE64" encoding More...
 
string Mime::mime_decode_base64_to_string (data str, *string encoding)
 returns a string value from a string in "BASE64" encoding More...
 
string Mime::mime_decode_header (string hdr)
 decodes a header string More...
 
string Mime::mime_decode_quoted_printable (string str, *string encoding, *bool is_body)
 returns a string parsed from "quoted-printable" (or "QP") encoding More...
 
data Mime::mime_decode_transfer_data (data mime_data, string enc, *string ct, *bool is_body)
 decodes data according to the given encoding More...
 

Detailed Description

Function Documentation

◆ mime_decode_base64()

binary Mime::mime_decode_base64 ( data  str)

returns a binary value from a string in "BASE64" encoding

According to RFC 2045

Parameters
strthe string to decode
Note
this function is basically just a wrapper for the standard Qore function parse_base64_string()

◆ mime_decode_base64_to_string()

string Mime::mime_decode_base64_to_string ( data  str,
*string  encoding 
)

returns a string value from a string in "BASE64" encoding

According to RFC 2045

Parameters
strthe string to decode
encodingthe character encoding to use for the string returned (if not present the default encoding is used)
Note
this function is basically just a wrapper for the standard Qore function parse_base64_string_to_string()

◆ mime_decode_header()

string Mime::mime_decode_header ( string  hdr)

decodes a header string

If any part of the string is encoded with "B" ("BASE64") or "Q" ("quoted-printable") encodings according to RFC 2045 section 6.7, then those parts are decoded and the decoded string is returned

Parameters
hdrthe header value string to decode
Returns
the decoded value of the header

◆ mime_decode_quoted_printable()

string Mime::mime_decode_quoted_printable ( string  str,
*string  encoding,
*bool  is_body 
)

returns a string parsed from "quoted-printable" (or "QP") encoding

According to RFC 2045 section 6.7

Parameters
strthe string to decode
encodingthe character encoding to use for the string returned (if not present the default encoding is used)
Exceptions
QUOTED-PRINTABLE-DECODE-ERRORan error occurred decoding the quoted-printable string

◆ mime_decode_transfer_data()

data Mime::mime_decode_transfer_data ( data  mime_data,
string  enc,
*string  ct,
*bool  is_body 
)

decodes data according to the given encoding

Parameters
mime_datathe data to decode
encthe decoding to use; see MIME Content Transfer Encoding Constants for possible values (case is ignored)
ctthe content-type of the data; if there is a "charset=xxx" component and the data is decoded to a string, then it will be returned in the given character encoding
Exceptions
MIME-TRANSFER-ENCODING-ERRORunknown transfer encoding