1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-26 17:38:12 +02:00
Files
archived-doc-ja/reference/unicode/functions/unicode-set-error-mode.xml
T
2010-03-29 00:47:47 +00:00

188 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: takagi Status: ready -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.unicode-set-error-mode">
<refnamediv>
<refname>unicode_set_error_mode</refname>
<refpurpose>文字列変換のエラーモードを設定する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>unicode_set_error_mode</methodname>
<methodparam><type>int</type><parameter>direction</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、異なるエンコーディング間での文字列変換の際のエラーモードを設定します。
文字列変換の際にエラーが発生する原因としては、
不正な文字があらわれた場合や
変換先のエンコードで表現できない文字があらわれた場合などがあります。
デフォルトでは、エラーが発生したらその場で変換を停止します。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>direction</parameter></term>
<listitem>
<para>
<parameter>direction</parameter> は、
そのエラーモードを適用する変換方向を設定します。
<constant>FROM_UNICODE</constant><constant>TO_UNICODE</constant>
のいずれかです。
<constant>FROM_UNICODE</constant> の場合は <type>unicode</type>
文字列からバイナリ文字列への変換、<constant>TO_UNICODE</constant>
の場合はバイナリ文字列から <type>unicode</type> 文字列への変換を表します。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
<parameter>mode</parameter> は、変換エラーの処理方法を指定します。
以下の定数のいずれかとなります。
</para>
<para>
<table>
<title>使用できるモード</title>
<tgroup cols="2">
<thead>
<row>
<entry>モード</entry>
<entry>説明</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<constant>U_CONV_ERROR_STOP</constant>
</entry>
<entry>
変換を停止する。これがデフォルトのモードです。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_SKIP</constant>
</entry>
<entry>
その文字を読み飛ばす。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_SUBST</constant>
</entry>
<entry>
特定の文字で置き換える。置き換える文字は
<function>unicode_set_subst_char</function> で設定します。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_ESCAPE_UNICODE</constant>
</entry>
<entry>
間違ったバイト列をエスケープし、Unicode 形式の文字フォーマットで表す。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_ESCAPE_ICU</constant>
</entry>
<entry>
間違ったバイト列をエスケープし、ICU 形式の文字フォーマットで表す。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_ESCAPE_JAVA</constant>
</entry>
<entry>
間違ったバイト列をエスケープし、Java 形式の文字フォーマットで表す。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_ESCAPE_XML_DEC</constant>
</entry>
<entry>
間違ったバイト列をエスケープし、十進形式の文字フォーマットで表す。
</entry>
</row>
<row>
<entry>
<constant>U_CONV_ERROR_ESCAPE_XML_HEX</constant>
</entry>
<entry>
間違ったバイト列をエスケープし、十六進形式の文字フォーマットで表す。
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
direction あるいは mode に不正な値を指定した場合は
<constant>E_WARNING</constant> レベルのエラーが発生します。
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&warn.experimental.func;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>unicode_encode</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
-->