function tearDown()
 {
     lmb_use_charset_driver($this->prev_driver);
     parent::tearDown();
 }
Beispiel #2
0
lmb_require('limb/i18n/src/charset/lmbSingleByteCharsetDriver.class.php');
function lmb_use_charset_driver($driver)
{
    $prev_driver = lmb_get_charset_driver();
    $GLOBALS['LIMB_CHARSET_DRIVER'] = $driver;
    return $prev_driver;
}
function lmb_get_charset_driver()
{
    if (isset($GLOBALS['LIMB_CHARSET_DRIVER'])) {
        return $GLOBALS['LIMB_CHARSET_DRIVER'];
    }
}
if (!lmb_get_charset_driver()) {
    lmb_require('limb/i18n/src/charset/lmbSingleByteCharsetDriver.class.php');
    lmb_use_charset_driver(new lmbSingleByteCharsetDriver());
}
/**
 * Multibyte aware replacement for strlen()
 */
function lmb_strlen($string)
{
    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strlen($string);
}
/**
 * Multibyte aware replacement for substr()
 */
function lmb_substr($str, $start, $length = null)
{
    return $GLOBALS['LIMB_CHARSET_DRIVER']->_substr($str, $start, $length);
}