作者 邓超

解码问题

... ... @@ -19,7 +19,7 @@ use function Swoole\Coroutine\Http\request;
*/
class MailListV2 extends Base {
private $cache = 0;
private $cache = 600;
/**
* 当前邮箱下指定的文件夹
... ...
... ... @@ -37,7 +37,19 @@ class MailFun {
* @time 2023/3/27 13:55
*/
public static function mb_coding(string $str,array $appcode=[]){
return (new Header())->decode(trim($str," \t\n\r"));
$str = (new Header())->decode(trim($str," \t\n\r"));
// if(str_starts_with($str, '=?')){
// try {
// $encode = @mb_detect_encoding($str, array_merge(array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'),$appcode));
// if($encode){
// return @mb_convert_encoding($str, 'UTF-8', $encode);
// }
// }catch (\Throwable $e){
//
// }
// }
return $str;
}
... ...