mirror of
https://github.com/php/doc-ja.git
synced 2026-04-28 02:23:18 +02:00
bc10bcb956
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@328386 c90b9560-bf6c-de11-be94-00142212c4b1
177 lines
4.9 KiB
XML
177 lines
4.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: e25450d9dc5f49da38026350643730de2017ac67 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: takagi -->
|
|
<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>出力バッファ内で文字エンコーディングを変換するコールバック関数</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> は、
|
|
<function>ob_start</function> のコールバック関数です。
|
|
<function>mb_output_handler</function> は、出力バッファの文字を
|
|
内部文字エンコーディングから HTTP 出力文字エンコーディングに変換します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>contents</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
出力バッファの中身。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>status</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
出力バッファの状態。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
変換後の文字列を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>4.1.0</entry>
|
|
<entry>
|
|
<para>
|
|
以下の条件が満たされた場合に、このハンドラは
|
|
charset HTTP ヘッダを設定します。
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<function>header</function> で <literal>Content-Type</literal>
|
|
が設定されていない
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
デフォルトの MIME 型が <literal>text/</literal> で始まる
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<link linkend="ini.mbstring.http-input">mbstring.http_input</link>
|
|
の設定が <literal>pass</literal> 以外である
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>mb_output_handler</function> の例</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>
|
|
PHP 4.3.0 以降において、
|
|
イメージのようなバイナリデータを出力したい場合、
|
|
バイナリデータを送信する前に <function>header</function> により
|
|
Content-Type: ヘッダ(例:header("Content-Type: image/png"))を
|
|
送信する必要があります。Content-Type: ヘッダが送信されると出力文字
|
|
コード変換は無効となります。
|
|
</para>
|
|
<para>
|
|
'Content-Type: text/*'
|
|
を送信した場合には、テキストが送信されるとみなし、文字コード設定に
|
|
基づいて出力文字コード変換を行います。
|
|
</para>
|
|
<para>
|
|
なお、PHP 4.2.x あるいはそれ以前のバージョンで画像のようなバイナリデータを
|
|
出力する場合には、<function>mb_http_output</function> を用いて
|
|
出力エンコーディングを "pass" に設定する必要があります。
|
|
</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
|
|
-->
|