作者 邓超

解码问题

@@ -19,7 +19,7 @@ use function Swoole\Coroutine\Http\request; @@ -19,7 +19,7 @@ use function Swoole\Coroutine\Http\request;
19 */ 19 */
20 class MailListV2 extends Base { 20 class MailListV2 extends Base {
21 21
22 - private $cache = 0; 22 + private $cache = 600;
23 23
24 /** 24 /**
25 * 当前邮箱下指定的文件夹 25 * 当前邮箱下指定的文件夹
@@ -37,7 +37,19 @@ class MailFun { @@ -37,7 +37,19 @@ class MailFun {
37 * @time 2023/3/27 13:55 37 * @time 2023/3/27 13:55
38 */ 38 */
39 public static function mb_coding(string $str,array $appcode=[]){ 39 public static function mb_coding(string $str,array $appcode=[]){
40 - return (new Header())->decode(trim($str," \t\n\r")); 40 + $str = (new Header())->decode(trim($str," \t\n\r"));
  41 +// if(str_starts_with($str, '=?')){
  42 +// try {
  43 +// $encode = @mb_detect_encoding($str, array_merge(array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'),$appcode));
  44 +// if($encode){
  45 +// return @mb_convert_encoding($str, 'UTF-8', $encode);
  46 +// }
  47 +// }catch (\Throwable $e){
  48 +//
  49 +// }
  50 +// }
  51 +
  52 + return $str;
41 } 53 }
42 54
43 55