mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-29 12:22:19 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@274140 c90b9560-bf6c-de11-be94-00142212c4b1
131 lines
3.5 KiB
XML
131 lines
3.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.14 $ -->
|
|
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.mb-detect-encoding" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mb_detect_encoding</refname>
|
|
<refpurpose>Détecte un encodage</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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><initializer>mb_detect_order()</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>strict</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Détecte l'encodage utilisé par la chaîne <parameter>str</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>str</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La chaîne à analyser.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding_list</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>encoding_list</parameter> est une liste d'encodages,
|
|
sous forme de tableau, ou bien de chaîne, les valeurs étant séparées
|
|
par des virgules.
|
|
</para>
|
|
<para>
|
|
Si <parameter>encoding_list</parameter> est omis,
|
|
l'ordre spécifié par <function>mb_detect_order</function> est utilisé.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>strict</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>strict</parameter> spécifie si l'on doit utiliser
|
|
une détection de l'encodage strict ou non.
|
|
Par défaut, vaut &false;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
L'encodage détecté.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>mb_detect_encoding</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* Détecte l'encodage avec les valeurs par défaut */
|
|
echo mb_detect_encoding($str);
|
|
|
|
/* "auto" signifie "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
|
|
echo mb_detect_encoding($str, "auto");
|
|
|
|
/* Spécifie une liste d'encodages possibles avec une liste à virgules */
|
|
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");
|
|
|
|
/* Spécifie une liste d'encodages possibles avec un tableau */
|
|
$ary[] = "ASCII";
|
|
$ary[] = "JIS";
|
|
$ary[] = "EUC-JP";
|
|
echo mb_detect_encoding($str, $ary);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mb_detect_order</function></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:"../../../../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
|
|
--> |