public static function charsetStrlen($string, $charset = "UTF-8")
    {
        if (function_exists('mb_strlen')) {
            return mb_strlen($string, $charset);
        }
        if (function_exists('iconv_strlen')) {
            return iconv_strlen($string, $charset);
        }

        throw new PListException('neither iconv nor mbstring supported. how are we supposed to work on strings here?');
    }