<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.mb-internal-encoding.php',
    1 => 'mb_internal_encoding',
    2 => 'Lit/modifie l\'encodage interne',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res multioctets',
  ),
  'prev' => 
  array (
    0 => 'function.mb-http-output.php',
    1 => 'mb_http_output',
  ),
  'next' => 
  array (
    0 => 'function.mb-language.php',
    1 => 'mb_language',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mbstring/functions/mb-internal-encoding.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-internal-encoding" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_internal_encoding</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_internal_encoding</span> &mdash; <span class="dc-title">Lit/modifie l&#039;encodage interne</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-internal-encoding-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_internal_encoding</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="para rdfs-comment">
   Lit/modifie l&#039;encodage interne.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-internal-encoding-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">encoding</code> sert lors des conversions des
       chaînes en provenance et en direction du web, ainsi que lors de
       la création de chaînes avec le module mbstring. Il faut garder à
       l&#039;esprit que l&#039;encodage interne est totalement différent
       de celui pour les regex multioctets.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-internal-encoding-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Si <code class="parameter">encoding</code> est fourni,
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
   Dans ce cas, l&#039;encodage des caractères pour les regex multioctets
   n&#039;est pas changé. Si <code class="parameter">encoding</code>
   est omis, <span class="function"><strong>mb_internal_encoding()</strong></span> retourne le
   nom de l&#039;encodage courant.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.mb-internal-encoding-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   À partir de PHP 8.0.0, une <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> est lancée si la valeur
   de <code class="parameter">encoding</code> est un encodage invalide.
   Antérieurement à PHP 8.0.0, une <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> était émise à la place.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-internal-encoding-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> est désormais nullable.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Lance désormais une <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> si
       <code class="parameter">encoding</code> est un encodage invalide.
       Auparavant, une <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> était émise à la place.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-internal-encoding-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>mb_internal_encoding()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/* Utilise l'encodage interne UTF-8 */<br /></span><span style="color: #0000BB">mb_internal_encoding</span><span style="color: #007700">(</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Affiche l'encodage interne courant */<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">mb_internal_encoding</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 

 <div class="refsect1 seealso" id="refsect1-function.mb-internal-encoding-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-http-input.php" class="function" rel="rdfs-seeAlso">mb_http_input()</a> - D&eacute;tecte le type d'encodage d'un caract&egrave;re HTTP</span></li>
    <li><span class="function"><a href="function.mb-http-output.php" class="function" rel="rdfs-seeAlso">mb_http_output()</a> - Lit/modifie l'encodage d'affichage</span></li>
    <li><span class="function"><a href="function.mb-detect-order.php" class="function" rel="rdfs-seeAlso">mb_detect_order()</a> - Lit/modifie l'ordre de d&eacute;tection des encodages</span></li>
    <li><span class="function"><a href="function.mb-regex-encoding.php" class="function" rel="rdfs-seeAlso">mb_regex_encoding()</a> - D&eacute;finit/R&eacute;cup&egrave;re l'encodage des caract&egrave;res pour les expressions r&eacute;guli&egrave;res multioctets</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>