Files
doc-fr/reference/mbstring/functions/mb-encode-mimeheader.xml
T
Yannick Torres a1a569e57e sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@173410 c90b9560-bf6c-de11-be94-00142212c4b1
2004-11-23 21:30:31 +00:00

91 lines
3.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry id="function.mb-encode-mimeheader">
<refnamediv>
<refname>mb_encode_mimeheader</refname>
<refpurpose>Encode une chaîne pour un en-tête MIME</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mb_encode_mimeheader</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>transfer_encoding</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>linefeed</parameter></methodparam>
</methodsynopsis>
<para>
<function>mb_encode_mimeheader</function> encode la chaîne
<parameter>str</parameter> en un en-tête MIME, et retourne la chaîne
convertie représentée en ASCII.
</para>
<para>
<parameter>charset</parameter> est le nom de l'encodage utilisé par la chaîne
<parameter>str</parameter>. La valeur par défaut est déterminée par les paramètres courants
du NLS (<literal>mbstring.language</literal>).
</para>
<para>
<parameter>transfer_encoding</parameter> est l'encodage de transfert. Il
peut être <literal>"B"</literal> (Base64) ou
<literal>"Q"</literal> (Quoted-Printable). Par défaut, c'est
<literal>"B"</literal>.
</para>
<para>
<parameter>linefeed</parameter> spécifie les fins de lignes (EOF : end-of-line) utilisé
par <function>mb_encode_mime_header</function> pour formater la chaîne (une
<ulink url="&url.rfc;2822">RFC</ulink>définie la longueur d'une chaîne à partir de laquelle
on doit ajouter une fin de ligne. La longueur courante est 74 caractères).
La valeur par défaut est <literal>"\r\n"</literal> (CRLF).
</para>
<para>
<example>
<title>Exemple avec <function>mb_convert_kana</function></title>
<programlisting role="php">
<![CDATA[
<?php
$name = ""; // kanji
$mbox = "kru";
$doma = "gtinn.mon";
$addr = mb_encode_mimeheader($name, "UTF-7", "Q") . "<" . $mbox . "@" . $doma . ">";
echo $addr;
?>
]]>
</programlisting>
</example>
</para>
<note>
<para>
Cette fonction n'est pas faîte pour couper les lignes en milieu de mots.
Ce comportement peut ajouter des espaces non désirées dans un mot de la chaîne originale.
</para>
</note>
<para>
Voir aussi
<function>mb_decode_mimeheader</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
-->