On 09/27/2016 05:37 PM, Vladimir Gorpenko wrote:
// return if encoding found, string matches encoding and
convert succeeded if (in_array($mb_from, $mbstring_list) && in_array($mb_to, $mbstring_list)) { if (mb_check_encoding($str, $mb_from)) { // Do the same as //IGNORE with iconv mb_substitute_character('none'); $out = mb_convert_encoding($str, $mb_to, $mb_from); mb_substitute_character($mbstring_sch);
if ($out !== false) { return $out; } } }
I don't decide to adapt your fix to my rcube_charset version.
In general mb_list_encodings() and mb_check_encoding() is not used now.
I did some more test and indeed mb_check_encoding() does not work with 'GBK', but mb_convert_encoding() does (at least with sample text I've got). So, I assume current git-master code will work for you as well.