【问题标题】:quoted_printable_decode some words with accent returns �quoted_printable_decode 一些带重音的单词返回 �
【发布时间】:2021-03-20 09:59:38
【问题描述】:

问题是关于 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 client=E8le

返回的服务 - la client.le

现在我该如何修复返回的零件?

【问题讨论】:

    标签: php decode quoted-printable


    【解决方案1】:

    尝试将编码更改为 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改成UTF8

    【讨论】:

    • 它有效,但只适用于一小部分Service à la clientèle,但对于其余部分,它给出了这个:Chère cliente, Cher client, 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。 Puisque votre opinion nous tient à cœur, nous vous invitons à participer à un sondage rapide comprenant sept questions. Trois minutes suffisent pour y répondre!
    • @Jintor 你知道什么是原始编码吗?
    • 在这个示例中,我看到了 但这个示例似乎混合在一起...对于这个示例,我在quote_printable_decode...是所有quote_printables的列表或表格吗?
    • 我在“Latin-1 Supplement”部分找到了一个列表en.wikipedia.org/wiki/List_of_Unicode_characters,如果我看到 U+00E8(是 =E8 的 qprint)...等
    • 试试这个:$str = quoted_printable_decode($str); $str = iconv('UTF-8','ASCII//TRANSLIT//IGNORE',$str);
    猜你喜欢
    • 2013-01-02
    • 1970-01-01
    • 2010-11-29
    • 1970-01-01
    • 2013-08-06
    • 2013-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多