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
130 lines
3.8 KiB
XML
130 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-convert-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_convert_encoding</refname>
|
|
<refpurpose>文字エンコーディングを変換する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_encoding</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>to_encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>from_encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
文字列 <parameter>str</parameter>の文字エンコーディングを、
|
|
オプションで指定した <parameter>from_encoding</parameter> から
|
|
<parameter>to_encoding</parameter> に変換します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>str</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
変換する文字列。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>to_encoding</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>str</parameter> の変換後の文字エンコーディング。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>from_encoding</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
変換前の文字エンコーディング名を指定します。
|
|
これは、配列またはカンマ区切りの文字列とすることが可能です。
|
|
<parameter>from_encoding</parameter>
|
|
を指定しなかった場合は、内部文字エンコーディングを使用します。
|
|
<!-- link to internal encoding info -->
|
|
</para>
|
|
<para>
|
|
<link linkend="mbstring.supported-encodings">
|
|
サポートされる文字エンコーディング</link>を参照ください。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
変換後の文字列を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_encoding</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* 内部文字エンコーディングからSJISに変換 */
|
|
$str = mb_convert_encoding($str, "SJIS");
|
|
|
|
/* EUC-JPからUTF-7に変換 */
|
|
$str = mb_convert_encoding($str, "UTF-7", "EUC-JP");
|
|
|
|
/* JIS, eucjp-win, sjis-winの順番で自動検出し、UCS-2LEに変換 */
|
|
$str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");
|
|
|
|
/* "auto" は、"ASCII,JIS,UTF-8,EUC-JP,SJIS" に展開される */
|
|
$str = mb_convert_encoding($str, "EUC-JP", "auto");
|
|
?>
|
|
]]>
|
|
</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
|
|
-->
|