public static function convertCharset($string, $fromCharset, $toCharset = 'UTF-8')
    {
        if (function_exists('mb_convert_encoding')) {
            return mb_convert_encoding($string, $toCharset, $fromCharset);
        }
        if (function_exists('iconv')) {
            return iconv($fromCharset, $toCharset, $string);
        }
        if (function_exists('recode_string')) {
            return recode_string($fromCharset .'..'. $toCharset, $string);
        }

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