mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 23:08:55 +00:00

See: http://www.w3.org/TR/2000/REC-xml-20001006#sec-TextDecl git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55418 c90b9560-bf6c-de11-be94-00142212c4b1
191 lines
5.6 KiB
XML
191 lines
5.6 KiB
XML
<?xml encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<reference id="ref.iconv">
|
|
<title>iconv functions</title>
|
|
<titleabbrev>iconv</titleabbrev>
|
|
|
|
<partintro>
|
|
<para>
|
|
This module contains an interface to the iconv library functions. To
|
|
be able to use the functions defined in this
|
|
module you must compile you PHP interpreter using the --with-iconv
|
|
option. In order to do so, you must have iconv() function in
|
|
standard C library or libiconv installed on your system.
|
|
libiconv library is available from <ulink url="&url.libiconv;">
|
|
&url.libiconv;</ulink>.
|
|
</para>
|
|
|
|
<para>
|
|
iconv library function converts files between various encoded
|
|
character sets. The supported character sets depend on iconv()
|
|
implementation on your system. Note that iconv() function in some
|
|
system is not work well as you expect. In this case, you should
|
|
install libiconv library.
|
|
</para>
|
|
</partintro>
|
|
|
|
<refentry id="function.iconv">
|
|
<refnamediv>
|
|
<refname>iconv</refname>
|
|
<refpurpose>Convert string to requested character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>iconv</function></funcdef>
|
|
<paramdef>string <parameter>in_charset</parameter></paramdef>
|
|
<paramdef>string <parameter>out_charset</parameter></paramdef>
|
|
<paramdef>string <parameter>str</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
It converts the string <parameter>string</parameter> encoded in
|
|
<parameter>in_charset</parameter> to the string encoded in
|
|
<parameter>out_charset</parameter>. It returns the converted
|
|
string or &false;, if it fails.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>iconv</function> example:</title>
|
|
<programlisting role="php">
|
|
echo iconv("ISO-8859-1","UTF-8","This is test.");
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.iconv-get-encoding">
|
|
<refnamediv>
|
|
<refname>iconv_get_encoding</refname>
|
|
<refpurpose>
|
|
Get current setting for character encoding conversion
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>iconv_get_encoding</function></funcdef>
|
|
<paramdef>string
|
|
<parameter><optional>type</optional></parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
It returns the current settings of
|
|
<function>ob_iconv_handler</function> as array or
|
|
&false; in failure.
|
|
</para>
|
|
<para>
|
|
See also:
|
|
<function>iconv_set_encoding</function> and
|
|
<function>ob_iconv_handler</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.iconv-set-encoding">
|
|
<refnamediv>
|
|
<refname>iconv_set_encoding</refname>
|
|
<refpurpose>
|
|
Set current setting for character encoding conversion
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>iconv_set_encoding</function></funcdef>
|
|
<paramdef>string <parameter>type</parameter></paramdef>
|
|
<paramdef>string <parameter>charset</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
It changes the value of <parameter>type</parameter> to
|
|
<parameter>charset</parameter> and returns &true; in success or
|
|
&false; in failure.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>iconv_set_encoding</function> example:</title>
|
|
<programlisting role="php">
|
|
iconv_set_encoding("internal_encoding", "UTF-8");
|
|
iconv_set_encoding("output_encoding", "ISO-8859-1");
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also:
|
|
<function>iconv_get_encoding</function> and
|
|
<function>ob_iconv_handler</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ob-iconv-handler">
|
|
<refnamediv>
|
|
<refname>ob_iconv_handler</refname>
|
|
<refpurpose>
|
|
Convert character encoding as output buffer handler
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>ob_iconv_handler</function></funcdef>
|
|
<paramdef>string
|
|
<parameter>contents</parameter>
|
|
</paramdef>
|
|
<paramdef>int
|
|
<parameter>status</parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
It converts the string encoded in
|
|
<parameter>internal_encoding</parameter> to
|
|
<parameter>output_encoding</parameter>.
|
|
</para>
|
|
<para>
|
|
<parameter>internal_encoding</parameter> and
|
|
<parameter>output_encoding</parameter> should be defined
|
|
by <function>iconv_set_encoding</function> or in
|
|
configuration file.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>ob_iconv_handler</function> example:</title>
|
|
<programlisting role="php">
|
|
ob_start("ob_iconv_handler"); // start output buffering
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also:
|
|
<function>iconv_get_encoding</function> and
|
|
<function>iconv_set_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- 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
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|