解码“=C3=A4"在字符串中 [英] Decoding "=C3=A4" in a string
问题描述
我尝试了很多不同的方法来正确显示我的字符串,但我无法让它工作.
I tried a lot of different things to get my string correctly displayed but I can't make it work.
这是字符串:f=C3=A4hrt(德语单词:fährt)
我的文件采用 utf-8 编码,文件在 Joomla 中加载.
My file is encoded in utf-8, the file is loaded within Joomla.
我都试过了
$geschichte->inhalt = utf8_encode($geschichte->inhalt);
和
$geschichte->inhalt = mb_convert_encoding($geschichte->inhalt, "UTF-8");
但没有任何效果.
希望有人能帮我...
推荐答案
这种编码与 UTF-8 之类的无关,看起来像 quoted printable 编码,最常见于电子邮件中.也许您正在解析电子邮件,需要注意特定的电子邮件标题并适当地解码内容.无论哪种方式,quoted_printable_decode
在这里都有帮助:
This encoding has nothing to do with UTF-8 or such, it looks like quoted printable encoding, which is most often found in emails. Perhaps you are parsing emails and will need to heed the specific email headers and decode the content appropriately. Either way, quoted_printable_decode
helps here:
echo quoted_printable_decode('f=C3=A4hrt'); // fährt
这篇关于解码“=C3=A4"在字符串中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!