mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 02:48:56 +00:00

Cf. <https://github.com/php/doc-en/pull/289>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@352191 c90b9560-bf6c-de11-be94-00142212c4b1
122 lines
3.7 KiB
XML
122 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.utf8-decode">
|
|
<refnamediv>
|
|
<refname>utf8_decode</refname>
|
|
<refpurpose>
|
|
Converts a string with ISO-8859-1 characters encoded with UTF-8
|
|
to single-byte ISO-8859-1
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>utf8_decode</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function converts the string <parameter>string</parameter> from the
|
|
<literal>UTF-8</literal> encoding to <literal>ISO-8859-1</literal>. Bytes
|
|
in the string which are not valid <literal>UTF-8</literal>, and
|
|
<literal>UTF-8</literal> characters which do not exist in
|
|
<literal>ISO-8859-1</literal> (that is, characters above
|
|
<literal>U+00FF</literal>) are replaced with <literal>?</literal>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Many web pages marked as using the <literal>ISO-8859-1</literal> character
|
|
encoding actually use the similar <literal>Windows-1252</literal> encoding,
|
|
and web browsers will interpret <literal>ISO-8859-1</literal> web pages as
|
|
<literal>Windows-1252</literal>. <literal>Windows-1252</literal> features
|
|
additional printable characters, such as the Euro sign
|
|
(<literal>€</literal>) and curly quotes (<literal>“</literal>
|
|
<literal>”</literal>), instead of certain <literal>ISO-8859-1</literal>
|
|
control characters. This function will not convert such
|
|
<literal>Windows-1252</literal> characters correctly. Use a different
|
|
function if <literal>Windows-1252</literal> conversion is required.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A UTF-8 encoded string.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns the ISO-8859-1 translation of <parameter>string</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>7.2.0</entry>
|
|
<entry>
|
|
This function has been moved to the core of PHP, and therefore lifting the requirement
|
|
on the XML extension for this function to be available.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>utf8_encode</function> - Performs the reverse conversion</member>
|
|
<member><function>mb_convert_encoding</function> - Converts between various character encodings, including UTF-8, ISO-8859-1 and Windows-1252</member>
|
|
<member><function>iconv</function> - Converts between various character encodings</member>
|
|
<member><function>recode_string</function> - Converts between various character encodings</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
|
|
-->
|