php-doc-en/functions/iconv.xml
Hartmut Holzgraefe 4c31e191c5 en Upgrade to DocBook4
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@69281 c90b9560-bf6c-de11-be94-00142212c4b1
2002-02-02 15:36:11 +00:00

188 lines
5.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<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>
<methodsynopsis>
<type>string</type><methodname>iconv</methodname>
<methodparam><type>string</type><parameter>in_charset</parameter></methodparam>
<methodparam><type>string</type><parameter>out_charset</parameter></methodparam>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
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>
<methodsynopsis>
<type>array</type><methodname>iconv_get_encoding</methodname>
<methodparam choice="opt"><type>string</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<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>
<methodsynopsis>
<type>array</type><methodname>iconv_set_encoding</methodname>
<methodparam><type>string</type><parameter>type</parameter></methodparam>
<methodparam><type>string</type><parameter>charset</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
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>
<methodsynopsis>
<type>array</type><methodname>ob_iconv_handler</methodname>
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
<methodparam><type>int</type><parameter>status</parameter></methodparam>
</methodsynopsis>
<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">
<![CDATA[
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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../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
-->