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@135250 c90b9560-bf6c-de11-be94-00142212c4b1
79 lines
2.5 KiB
XML
79 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- splitted from ./en/functions/mbstring.xml, last change in rev 1.1 -->
|
|
<refentry id="function.mb-convert-encoding">
|
|
<refnamediv>
|
|
<refname>mb_convert_encoding</refname>
|
|
<refpurpose>Convert character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_encoding</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>to-encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>from-encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_convert_encoding</function> converts
|
|
character encoding of string <parameter>str</parameter> from
|
|
<parameter>from-encoding</parameter> to
|
|
<parameter>to-encoding</parameter>.
|
|
</para>
|
|
<para>
|
|
<parameter>str</parameter> : String to be converted.
|
|
</para>
|
|
<para>
|
|
<parameter>from-encoding</parameter> is specified by character
|
|
code name before conversion. it can be array or string - comma
|
|
separated enumerated list. If it is not specified, the internal
|
|
encoding will be used.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_encoding</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* Convert internal character encoding to SJIS */
|
|
$str = mb_convert_encoding($str, "SJIS");
|
|
|
|
/* Convert EUC-JP to UTF-7 */
|
|
$str = mb_convert_encoding($str, "UTF-7", "EUC-JP");
|
|
|
|
/* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */
|
|
$str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");
|
|
|
|
/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
|
|
$str = mb_convert_encoding($str, "EUC-JP", "auto");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>mb_detect_order</function>.
|
|
</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:"../../../../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
|
|
-->
|