<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.2 $ --> <!-- splitted from ./en/functions/mbstring.xml, last change in rev 1.1 --> <refentry id="function.mb-detect-encoding"> <refnamediv> <refname>mb_detect_encoding</refname> <refpurpose>Detect character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>mb_detect_encoding</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>encoding-list</parameter></methodparam> </methodsynopsis> <para> <function>mb_detect_encoding</function> detects character encoding in string <parameter>str</parameter>. It returns detected character encoding. </para> <para> <parameter>encoding-list</parameter> is list of character encoding. Encoding order may be specified by array or comma separated list string. </para> <para> If <parameter>encoding_list</parameter> is omitted, detect_order is used. </para> <para> <example> <title><function>mb_detect_encoding</function> example</title> <programlisting role="php"> <![CDATA[ /* Detect character encoding with current detect_order */ echo mb_detect_encoding($str); /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */ echo mb_detect_encoding($str, "auto"); /* Specify encoding_list character encoding by comma separated list */ echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win"); /* Use array to specify encoding_list */ $ary[] = "ASCII"; $ary[] = "JIS"; $ary[] = "EUC-JP"; echo mb_detect_encoding($str, $ary); ]]> </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 -->