mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290987 c90b9560-bf6c-de11-be94-00142212c4b1
127 lines
3.5 KiB
XML
127 lines
3.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.iconv" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>iconv</refname>
|
|
<refpurpose>Convert string to requested character encoding</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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>
|
|
Performs a character set conversion on the string
|
|
<parameter>str</parameter> from <parameter>in_charset</parameter>
|
|
to <parameter>out_charset</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>in_charset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The input charset.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>out_charset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The output charset.
|
|
</para>
|
|
<para>
|
|
If you append the string <literal>//TRANSLIT</literal> to
|
|
<parameter>out_charset</parameter> transliteration is activated. This
|
|
means that when a character can't be represented in the target charset,
|
|
it can be approximated through one or several similarly looking
|
|
characters. If you append the string <literal>//IGNORE</literal>,
|
|
characters that cannot be represented in the target charset are silently
|
|
discarded. Otherwise, <parameter>str</parameter> is cut from the first
|
|
illegal character and an <constant>E_NOTICE</constant> is generated.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>str</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The string to be converted.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns the converted string&return.falseforfailure;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>iconv</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "This is the Euro symbol '€'.";
|
|
|
|
echo 'Original : ', $text, PHP_EOL;
|
|
echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL;
|
|
echo 'IGNORE : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL;
|
|
echo 'Plain : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Original : This is the Euro symbol '€'.
|
|
TRANSLIT : This is the Euro symbol 'EUR'.
|
|
IGNORE : This is the Euro symbol ''.
|
|
Plain :
|
|
Notice: iconv(): Detected an illegal character in input string in .\iconv-example.php on line 7
|
|
This is the Euro symbol '
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|