正在显示
1 个修改的文件
包含
8 行增加
和
3 行删除
| @@ -37,10 +37,15 @@ class MailFun { | @@ -37,10 +37,15 @@ 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 | - $encode = mb_detect_encoding($str, array_merge(array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'),$appcode)); | ||
| 41 | - if($encode){ | ||
| 42 | - return mb_convert_encoding($str, 'UTF-8', $encode); | 40 | + try { |
| 41 | + $encode = @mb_detect_encoding($str, array_merge(array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'),$appcode)); | ||
| 42 | + if($encode){ | ||
| 43 | + return @mb_convert_encoding($str, 'UTF-8', $encode); | ||
| 44 | + } | ||
| 45 | + }catch (\Throwable $e){ | ||
| 46 | + | ||
| 43 | } | 47 | } |
| 48 | + | ||
| 44 | return $str; | 49 | return $str; |
| 45 | } | 50 | } |
| 46 | 51 |
-
请 注册 或 登录 后发表评论