From 1ad035ee05f2fa27973c029e8b325c63e8549f9e Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Mon, 22 Dec 2003 20:19:34 +0000 Subject: [PATCH] - Add "see also" section to iconv_mime_decode() and iconv_mime_encode() - Add documentation of iconv_mime_decode_headers() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147193 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/iconv-mime-decode-headers.xml | 156 ++++++++++++++++++ .../iconv/functions/iconv-mime-decode.xml | 10 +- .../iconv/functions/iconv-mime-encode.xml | 7 +- 3 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 reference/iconv/functions/iconv-mime-decode-headers.xml diff --git a/reference/iconv/functions/iconv-mime-decode-headers.xml b/reference/iconv/functions/iconv-mime-decode-headers.xml new file mode 100644 index 0000000000..26adb5b24e --- /dev/null +++ b/reference/iconv/functions/iconv-mime-decode-headers.xml @@ -0,0 +1,156 @@ + + + + + iconv_mime_decode_headers + + Decodes multiple MIME header fields at once + + + + Description + + arrayiconv_mime_decode + stringencoded_headers + intmode + stringcharset + + + + Returns an associative array that holds a whole set of + MIME header fields specified by + encoded_headers on success, or &false; + if an error occurs during the decoding. + + + + Each key of the return value represents an individual + field name and the corresponding element represents a field value. + If more than one field of the same field name are present, + iconv_mime_decode_headers automatically incorporates + them into an numerically indexed array in the order of occurrence. + + + + mode determines the behaviour in the event + iconv_mime_decode_headers encounters a malformed + MIME header field. You can specify any combination + of the following bitmasks. + + Bitmasks acceptable to <function>iconv_mime_decode_headers</function> + + + + Value + Constant + Description + + + + + 1 + ICONV_MIME_DECODE_STRICT + + If set, the given header is decoded in full conformance with the + standards defined in RFC2047. + This option is disabled by default because there are a lot of + broken mail user agents that don't follow the specification and don't + produce correct MIME headers. + + + + 2 + ICONV_MIME_DECODE_CONTINUE_ON_ERROR + + If set, iconv_mime_decode_headers + attempts to continue to process the given header even though + an error occurs. + + + + +
+
+ + + The optional charset parameter specifies the + character set to represent the result by. If omitted, + iconv.internal_charset + will be used. + + + + + <function>iconv_mime_decode_function</function> example + + +Received: from localhost (localhost [127.0.0.1]) by localhost + with SMTP id example for ; + Thu, 1 Jan 1970 00:00:00 +0000 (UTC) + (envelope-from example-return-0000-example=example.com@example.com) +Received: (qmail 0 invoked by uid 65534); 1 Thu 2003 00:00:00 +0000 + +EOF; + +$headers = iconv_mime_decode_headers($headers_string, 0, "ISO-8859-1"); +print_r($headers); +?> +]]> + + + The output of this script should look like: + + + Prüfung Prüfung + [To] => example@example.com + [Date] => Thu, 1 Jan 1970 00:00:00 +0000 + [Message-Id] => + [Received] => Array + ( + [0] => from localhost (localhost [127.0.0.1]) by localhost with SMTP id example for ; Thu, 1 Jan 1970 00:00:00 +0000 (UTC) (envelope-from example-return-0000-example=example.com@example.com) + [1] => (qmail 0 invoked by uid 65534); 1 Thu 2003 00:00:00 +0000 + ) + +) +]]> + + + + + + See also iconv_mime_decode, + imap_base64_decode, + and imap_qprint. + +
+
+ + diff --git a/reference/iconv/functions/iconv-mime-decode.xml b/reference/iconv/functions/iconv-mime-decode.xml index 45fd7a72f0..980911331e 100644 --- a/reference/iconv/functions/iconv-mime-decode.xml +++ b/reference/iconv/functions/iconv-mime-decode.xml @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ Description stringiconv_mime_decode - stringencoded_string + stringencoded_header intmode stringcharset @@ -83,6 +83,12 @@ echo iconv_mime_decode("Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=", + + + See also iconv_mime_decode_headers, + imap_base64_decode, + and imap_qprint. + diff --git a/reference/iconv/functions/iconv-mime-encode.xml b/reference/iconv/functions/iconv-mime-encode.xml index c2085c5705..2debc89ec1 100644 --- a/reference/iconv/functions/iconv-mime-encode.xml +++ b/reference/iconv/functions/iconv-mime-encode.xml @@ -1,5 +1,5 @@ - + @@ -145,6 +145,11 @@ echo iconv_mime_encode("Subject", "Prüfung Prüfung", $preferences); + + + See also imap_base64_encode, + and imap_8bit. +