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@298998 c90b9560-bf6c-de11-be94-00142212c4b1
141 lines
3.9 KiB
XML
141 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: takagi Status: ready -->
|
|
<refentry xml:id="function.unicode-encode" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>unicode_encode</refname>
|
|
<refpurpose>unicode 文字列を任意のエンコーディングに変換する</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>unicode_encode</methodname>
|
|
<methodparam><type>unicode</type><parameter>input</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>errmode</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<type>unicode</type> 文字列を受け取り、それを指定したエンコーディング
|
|
<parameter>encoding</parameter> の文字列に変換します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>input</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
エンコードする <type>unicode</type> 文字列。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>input</parameter> の新しいエンコーディング。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>errmode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
変換エラーモード。このパラメータで、
|
|
コンバータが文字を変換できなかったときの動作を指定します。
|
|
使用できるモードについては <function>unicode_set_error_mode</function>
|
|
を参照ください。このパラメータを省略した場合は、グローバルなエラーモードを使用します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
成功した場合に文字列、&return.falseforfailure;。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
指定したエンコーディングの変換器が作成できない場合に
|
|
<constant>E_WARNING</constant> レベルのエラーが発生します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>unicode_encode</function> の例</title>
|
|
<para>
|
|
注意: 出力は、エンティティではなく文字になります。
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
header ('Content-Type: text/plain; charset=ISO-8859-2');
|
|
|
|
$encoded = unicode_encode ('\u0150\u0179', 'ISO-8859-2');
|
|
|
|
echo 'The string itself:', $encoded, PHP_EOL;
|
|
echo 'The length of the string: ', strlen ($encoded);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Unicode semantics: 1
|
|
The string itself: ŐŹ
|
|
The length of the string: 2
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
&warn.experimental.func;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>unicode_set_error_mode</function></member>
|
|
<member><function>unicode_decode</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
|
|
-->
|