<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.filter.set.stringtolower">
    <title>StringToLower</title>

    <para>
        This filter converts any input to be lowercased.
    </para>

    <sect3 id="zend.filter.set.stringtolower.options">
        <title>Supported options for Zend_Filter_StringToLower</title>

        <para>
            The following options are supported for
            <classname>Zend_Filter_StringToLower</classname>:
        </para>

        <itemizedlist>
            <listitem>
                <para>
                    <emphasis><property>encoding</property></emphasis>: This option can be used to
                    set an encoding which has to be used.
                </para>
            </listitem>
        </itemizedlist>
    </sect3>

    <sect3 id="zend.filter.set.stringtolower.basic">
        <title>Basic usage</title>

        <para>
            This is a basic example:
        </para>

        <programlisting language="php"><![CDATA[
$filter = new Zend_Filter_StringToLower();

print $filter->filter('SAMPLE');
// returns "sample"
]]></programlisting>
    </sect3>

    <sect3 id="zend.filter.set.stringtolower.encoding">
        <title>Different encoded strings</title>

        <para>
            Per default it will only handle characters from the actual locale of your
            server. Characters from other charsets would be ignored. Still, it's
            possible to also lowercase them when the mbstring extension is available
            in your environment. Simply set the wished encoding when initiating the
            <classname>StringToLower</classname> filter. Or use the
            <methodname>setEncoding()</methodname> method to change the encoding afterwards.
        </para>

        <programlisting language="php"><![CDATA[
// using UTF-8
$filter = new Zend_Filter_StringToLower('UTF-8');

// or give an array which can be useful when using a configuration
$filter = new Zend_Filter_StringToLower(array('encoding' => 'UTF-8'));

// or do this afterwards
$filter->setEncoding('ISO-8859-1');
]]></programlisting>

        <note>
            <title>Setting wrong encodings</title>

            <para>
                Be aware that you will get an exception when you want to set an encoding
                and the mbstring extension is not available in your environment.
            </para>

            <para>
                Also when you are trying to set an encoding which is not supported by your
                mbstring extension you will get an exception.
            </para>
        </note>
    </sect3>
</sect2>
