Decoding “=C3=A4” in a string

不想你离开。 提交于 2021-01-29 04:44:11

问题


I tried a lot of different things to get my string correctly displayed but I can't make it work.

That's the string: f=C3=A4hrt (German word: fährt)

My file is encoded in utf-8, the file is loaded within Joomla.

I tried both

$geschichte->inhalt = utf8_encode($geschichte->inhalt);

and

$geschichte->inhalt = mb_convert_encoding($geschichte->inhalt, "UTF-8"); but nothing works.

I hope someone can help me...


回答1:


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


来源:https://stackoverflow.com/questions/52078879/decoding-c3-a4-in-a-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!