0

问题是关于 PHP 函数quoted_printable_decode 并返回一些...。

样本(quoted_printable_decode 之前的原始数据)

<table width=3D"750" border=3D"0" align=3D"center" cellpa=
dding=3D"0" cellspacing=3D"0">
=09=09=09=09=09=09<tr>
=09=09=09=09=09=09<td class=3D"contenu">
=09=09=09=09=09=09=09=09<div class=3D"txt-contenu">
=09=09=09=09=09=09=09=09<p>Chère cliente, Cher client,</p>
=09=09=09=09=09=09=09=09<p>Selon nos dossiers, une personne de votre entrep=
rise a contacté notre Service =E0 la client=E8le récemment, e=
t nous aimerions savoir si elle est satisfaite du service qu’elle a re&cced=
il;u.
=09=09=09=09=09=09=09=09</p>
=09=09=09=09=09=09=09=09<p>
=09=09=09=09=09=09=09=09=09Puisque votre opinion nous tient à c&oeli=
g;ur, nous vous invitons à participer à un sondage rapide com=
prenant sept questions. Trois minutes suffisent pour y répondre!
=09=09=09=09=09=09=09=09</p>

在quoted_printable_decode之后

      echo quoted_printable_decode($raw);
    
    returns this:     <table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tbody><tr>
                                <td class="contenu">
                                        <div class="txt-contenu">
                                        <p>Chère cliente, Cher client,</p>
                                        <p>Selon nos dossiers,
 une personne de votre entreprise a contacté notre 
Service � la client�le récemment, et nous aimerions savoir si elle est satisfaite du service qu’elle a reçu.
                                        </p>
                                        <p>
                                            Puisque votre opinion nous tient à cœur, nous vous invitons à participer à un sondage rapide comprenant sept questions. Trois minutes suffisent pour y répondre!

•••• 看来这部分

服务=E0 la 客户端=E8le

返回的服务 la client

现在我该如何修复返回的 � 部分?

4

1 回答 1

0

尝试将编码更改为 UTF-8。

$str = quoted_printable_decode($str);
$str = iconv(mb_detect_encoding($str, 'ISO-8859-1, ISO-8859-2'), 'UTF-8', $str);
echo $str;

用于mb_detect_encoding检测当前编码,然后通过iconv

于 2020-12-09T03:06:36.487 回答