正在显示
2 个修改的文件
包含
18 行增加
和
1 行删除
| @@ -493,3 +493,20 @@ function get_email_uuid($subject,$udate,$form,$to,$size){ | @@ -493,3 +493,20 @@ function get_email_uuid($subject,$udate,$form,$to,$size){ | ||
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | 495 | ||
| 496 | +/** | ||
| 497 | + * 转码 | ||
| 498 | + * @param string $str | ||
| 499 | + * @param string $to | ||
| 500 | + * @param string|null $from | ||
| 501 | + * @return string | ||
| 502 | + * @author:dc | ||
| 503 | + * @time 2024/8/29 10:51 | ||
| 504 | + */ | ||
| 505 | +function mb_iconv($str, $to, $from = null) { | ||
| 506 | + try { | ||
| 507 | + return mb_convert_encoding($str, $to, $from); | ||
| 508 | + }catch (Throwable $e){ | ||
| 509 | + return $str; | ||
| 510 | + } | ||
| 511 | +} | ||
| 512 | + |
| @@ -504,7 +504,7 @@ class Mail { | @@ -504,7 +504,7 @@ class Mail { | ||
| 504 | if(!$description && in_array($item['type']??'',['text/html','text/plain'])){ | 504 | if(!$description && in_array($item['type']??'',['text/html','text/plain'])){ |
| 505 | 505 | ||
| 506 | if(!empty($item['charset'])){ | 506 | if(!empty($item['charset'])){ |
| 507 | - $value = @iconv($item['charset'],'utf-8',$item['body']); | 507 | + $value = mb_iconv($item['body']?:'','utf-8',$item['charset']?:null); |
| 508 | $value = $value ? $value : $item['body']; | 508 | $value = $value ? $value : $item['body']; |
| 509 | }else{ | 509 | }else{ |
| 510 | $value = $item['body']; | 510 | $value = $item['body']; |
-
请 注册 或 登录 后发表评论