mirror of
https://github.com/php/doc-ja.git
synced 2026-04-28 18:43:16 +02:00
5e7aab1712
Closes GH-190. git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@352036 c90b9560-bf6c-de11-be94-00142212c4b1
171 lines
5.2 KiB
XML
171 lines
5.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 92f1b8b177eb5730382abf9f27bae868f1bb636f Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: takagi,mumumu -->
|
|
<refentry xml:id="function.mb-detect-order" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_detect_order</refname>
|
|
<refpurpose>文字エンコーディング検出順序を設定あるいは取得する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>bool</type></type><methodname>mb_detect_order</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>array</type><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
自動文字エンコーディング検出の順番を
|
|
<parameter>encoding</parameter> に設定します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>encoding</parameter> は、
|
|
配列またはカンマ区切りの文字エンコーディングのリストです。<link
|
|
linkend="mbstring.supported-encodings">サポートされる文字エンコーディング</link>を参照ください。
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> が省略された場合、または &null; の場合は、
|
|
現在の文字エンコーディング検出順を配列で返します。
|
|
</para>
|
|
<para>
|
|
この設定は、<function>mb_detect_encoding</function> および
|
|
<function>mb_send_mail</function> に影響します。
|
|
</para>
|
|
<para>
|
|
<literal>mbstring</literal> が現在実装しているのは、
|
|
以下のエンコーディングを検出するフィルタです。
|
|
以下のエンコーディングにおいて無効なバイトシーケンスがあった場合、
|
|
エンコーディング検出は失敗します。
|
|
</para>
|
|
<simpara>
|
|
<literal>UTF-8</literal>, <literal>UTF-7</literal>,
|
|
<literal>ASCII</literal>,
|
|
<literal>EUC-JP</literal>,<literal>SJIS</literal>,
|
|
<literal>eucJP-win</literal>, <literal>SJIS-win</literal>,
|
|
<literal>JIS</literal>, <literal>ISO-2022-JP</literal>
|
|
</simpara>
|
|
<para>
|
|
<literal>ISO-8859-*</literal>の場合、<literal>mbstring</literal>
|
|
は常に <literal>ISO-8859-*</literal> として検出します。
|
|
</para>
|
|
<para>
|
|
<literal>UTF-16</literal>, <literal>UTF-32</literal>,
|
|
<literal>UCS2</literal>, <literal>UCS4</literal> の場合、
|
|
エンコーディング検出は常に失敗します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
検出順序を設定する場合は、成功した場合に &true; を返し、失敗したときに &false; を返します。
|
|
</para>
|
|
<para>
|
|
検出順序を取得する場合は、エンコーディングの配列を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&mbstring.changelog.encoding-nullable;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>mb_detect_order</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* リストで検出順を設定 */
|
|
mb_detect_order("eucjp-win,sjis-win,UTF-8");
|
|
|
|
/* 配列で検出順を設定 */
|
|
$ary[] = "ASCII";
|
|
$ary[] = "JIS";
|
|
$ary[] = "EUC-JP";
|
|
mb_detect_order($ary);
|
|
|
|
/* 現在の検出順を表示 */
|
|
echo implode(", ", mb_detect_order());
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>無意味な順番の例</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
; 常に ISO-8859-1 として検出されます
|
|
detect_order = ISO-8859-1, UTF-8
|
|
|
|
; ASCII/UTF-7 の値は UTF-8 として有効なため、常に UTF-8 として検出されます
|
|
detect_order = UTF-8, ASCII, UTF-7
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_internal_encoding</function></member>
|
|
<member><function>mb_http_input</function></member>
|
|
<member><function>mb_http_output</function></member>
|
|
<member><function>mb_send_mail</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
|
|
-->
|