<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/filters.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'filters.convert.php',
    1 => 'Umwandlungsfilter',
    2 => 'Umwandlungsfilter',
  ),
  'up' => 
  array (
    0 => 'filters.php',
    1 => 'Liste verf&uuml;garer Filter',
  ),
  'prev' => 
  array (
    0 => 'filters.string.php',
    1 => 'Filter f&uuml;r Zeichenketten',
  ),
  'next' => 
  array (
    0 => 'filters.compression.php',
    1 => 'Komprimierungsfilter',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'appendices/filters.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="filters.convert" class="section">
  <h2 class="title">Umwandlungsfilter</h2>

  <p class="simpara">
   Wie die string.*-Filter führen auch die convert.*-Filter Aktionen aus, die
   ihren Namen entsprechen. Weitere Informationen zu einem bestimmten Filter
   sind auf der Handbuchseite für die entsprechende Funktion zu finden.
  </p>

  <div class="section" id="filters.convert.base64">
   <h2 class="title">convert.base64-encode und convert.base64-decode</h2>
   <p class="simpara">
    Die Verwendung dieser Filter entspricht der Verarbeitung aller
    Stream-Daten mit den Funktionen <span class="function"><a href="function.base64-encode.php" class="function">base64_encode()</a></span> und
    <span class="function"><a href="function.base64-decode.php" class="function">base64_decode()</a></span>.
    <code class="literal">convert.base64-encode</code> unterstützt Parameter, die als
    assoziatives Array übergeben werden. Wenn der Parameter
    <code class="parameter">line-length</code> angegeben wird, wird die base64-Ausgabe
    in Abschnitte von <code class="parameter">line-length</code> Zeichen aufgeteilt.
    Wenn der Parameter <code class="parameter">line-break-chars</code> angegeben wird,
    werden die einzelnen Teilstücke durch die angegebenen Zeichen getrennt.
    Diese Parameter haben die gleiche Wirkung wie die Verwendung von
    <span class="function"><a href="function.base64-encode.php" class="function">base64_encode()</a></span> in Verbindung mit
    <span class="function"><a href="function.chunk-split.php" class="function">chunk_split()</a></span>.
   </p>
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 
     convert.base64-encode &amp;
     convert.base64-decode
    </strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'convert.base64-encode'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"This is a test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* Ausgabe:  VGhpcyBpcyBhIHRlc3QuCg==  */<br /><br /></span><span style="color: #0000BB">$param </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'line-length' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">8</span><span style="color: #007700">, </span><span style="color: #DD0000">'line-break-chars' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"\r\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'convert.base64-encode'</span><span style="color: #007700">, </span><span style="color: #0000BB">STREAM_FILTER_WRITE</span><span style="color: #007700">, </span><span style="color: #0000BB">$param</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"This is a test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* Ausgabe:  VGhpcyBp<br />          :  cyBhIHRl<br />          :  c3QuCg==  */<br /><br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'convert.base64-decode'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"VGhpcyBpcyBhIHRlc3QuCg=="</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* Ausgabe:  This is a test.  */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </div>

  <div class="section" id="filters.covert.quoted-printable">
   <h2 class="title">convert.quoted-printable-encode und convert.quoted-printable-decode</h2>
   <p class="simpara">
    Die Verwendung der Decode-Version dieses Filters entspricht der
    Verarbeitung aller Stream-Daten mit der Funktion
    <span class="function"><a href="function.quoted-printable-decode.php" class="function">quoted_printable_decode()</a></span>. Es gibt keine Funktion, die
    <code class="literal">convert.quoted-printable-encode</code> entspricht.
    <code class="literal">convert.quoted-printable-encode</code> unterstützt Parameter,
    die als assoziatives Array übergeben werden. Zusätzlich zu den Parametern,
    die von <code class="literal">convert.base64-encode</code> unterstützt werden,
    unterstützt <code class="literal">convert.quoted-printable-encode</code> auch die
    booleschen Parameter <code class="parameter">binary</code> und
    <code class="parameter">force-encode-first</code>.
    <code class="literal">convert.base64-decode</code> unterstützt nur den Parameter
    <code class="parameter">line-break-chars</code>, der für die Zeilentrennung der
    kodierten Daten verwendet wird.
   </p>
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 convert.quoted-printable-encode &amp; convert.quoted-printable-decode</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'convert.quoted-printable-encode'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"This is a test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* Ausgabe:  =This is a test.=0A  */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </div>

  <div class="section" id="filters.convert.iconv">
   <h2 class="title">convert.iconv.*</h2>
   <p class="simpara">
    Die <code class="literal">convert.iconv.*</code>-Filter sind verfügbar, wenn die
    <a href="book.iconv.php" class="link">iconv</a>-Unterstützung aktiviert ist. Die
    Verwendung dieser Filter entspricht der Verarbeitung aller Stream-Daten
    mit der Funktion <span class="function"><a href="function.iconv.php" class="function">iconv()</a></span>. Diese Filter unterstützen
    keine Parameter, sondern erwarten stattdessen, dass die Eingabe- und
    Ausgabekodierungen als Teil des Filternamens angegeben werden, d. h.
    entweder als
    <code class="literal">convert.iconv.&lt;input-encoding&gt;.&lt;output-encoding&gt;</code>
    oder als
    <code class="literal">convert.iconv.&lt;input-encoding&gt;/&lt;output-encoding&gt;</code>
    (beide Schreibweisen sind semantisch äquivalent).
   </p>

   <div class="example" id="example-3">
    <p><strong>Beispiel #3 convert.iconv.*</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'convert.iconv.utf-16le.utf-8'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"T\0h\0i\0s\0 \0i\0s\0 \0a\0 \0t\0e\0s\0t\0.\0\n\0"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* Ausgabe: This is a test. */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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