mirror of
https://github.com/php/doc-ja.git
synced 2026-03-27 00:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@308243 c90b9560-bf6c-de11-be94-00142212c4b1
131 lines
3.8 KiB
XML
131 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: a07a17c15bc5fd5d01c704e768087028c7b05080 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: takagi -->
|
|
<refentry xml:id="function.mb-detect-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_detect_encoding</refname>
|
|
<refpurpose>文字エンコーディングを検出する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_detect_encoding</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>encoding_list</parameter><initializer>mb_detect_order()</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>strict</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
文字列 <parameter>str</parameter> の文字エンコーディングを検出します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>str</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
検出する文字列。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding_list</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>encoding_list</parameter> は文字エンコーディングのリストで、
|
|
エンコーディング検出の順番を配列またはカンマ区切りのリストで指定します。
|
|
</para>
|
|
<para>
|
|
<parameter>encoding_list</parameter> が省略された場合、
|
|
detect_order が使用されます。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>strict</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>strict</parameter> は、
|
|
厳格なエンコーディング検出を行うかどうかを指定します。
|
|
デフォルトは &false; です。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
検出した文字エンコーディングを返します。
|
|
指定した文字列からエンコーディングを検出できなかった場合は &false; を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>mb_detect_encoding</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* 現在のdetect_orderで文字エンコーディングを検出 */
|
|
echo mb_detect_encoding($str);
|
|
|
|
/* "auto" は mbstring.language の設定を使って展開されます */
|
|
echo mb_detect_encoding($str, "auto");
|
|
|
|
/* カンマ区切りのリストで encoding_list 文字エンコーディングを指定 */
|
|
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");
|
|
|
|
/* encoding_list を指定するために配列を使用 */
|
|
$ary[] = "ASCII";
|
|
$ary[] = "JIS";
|
|
$ary[] = "EUC-JP";
|
|
echo mb_detect_encoding($str, $ary);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_detect_order</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
|
|
-->
|