<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="function.mb-output-handler" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>mb_output_handler</refname> <refpurpose>Callback function converts character encoding in output buffer</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>mb_output_handler</methodname> <methodparam><type>string</type><parameter>contents</parameter></methodparam> <methodparam><type>int</type><parameter>status</parameter></methodparam> </methodsynopsis> <para> <function>mb_output_handler</function> is <function>ob_start</function> callback function. <function>mb_output_handler</function> converts characters in the output buffer from internal character encoding to HTTP output character encoding. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>contents</parameter></term> <listitem> <para> The contents of the output buffer. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>status</parameter></term> <listitem> <para> The status of the output buffer. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> The converted <type>string</type>. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>mb_output_handler</function> example</title> <programlisting role="php"> <![CDATA[ <?php mb_http_output("UTF-8"); ob_start("mb_output_handler"); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> If you want to output binary data, such as an image, a Content-Type: header must be set using <function>header</function> before any binary data is sent to the client (e.g. header("Content-Type: image/png")). If Content-Type: header is sent, output character encoding conversion will not be performed. </para> <para> Note that if 'Content-Type: text/*' is sent, the content body is regarded as text; conversion will take place. </para> </note> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>ob_start</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->