2013-10-16 33 views
0

如何將其轉換爲PHP或smarty的可讀字符串?URL包含「" M ä ä s "」ASCII,HEX它是什麼?以及如何轉換它?

(必須是容易的,因爲我看到這個編輯器將其轉換爲可讀的字符串,而不做任何事情)從標題

樣品是從該字符串:

正下方
Wer ist am Wochenende alles an der "Määs" anzutreffen? 

的字符串寫權利:

Wer ist am Wochenende alles an der "Määs" anzutreffen? 

我有這個問題,試圖包括一個Facebook的RSS提要。如果您想了解更多的這些還有更多這類字符串在這裏我們去:

http://www.facebook.com/feeds/page.php?format=atom10&id=113971395284126

回答

1

其實,它看起來像這樣,你需要htmlspecialchars_decode()而不是html_entity_decode();

使用htmlspecialchars_decode()獲得「Määs」,使用html_entity_decode()獲得「Määs」。

+0

in smarty「$ arr.title | html_entity_decode:$ smarty.const.ENT_QUOTES:'utf -8'| wordwrap:60「完成這項工作。所以它似乎html_entity_decode()工作正常,但htmlspecialchars_decode()不 – caramba

+0

不知道smarty,如果這對你很好。直接PHP我得到了上面列出的結果。 – spacebean

0

嘗試html_entity_decode()將其更改爲可讀的字符串。

+0

你也知道如何「" M ä ä s "」被稱爲?這是什麼樣的字符串?只是一個html特殊字符或什麼? – caramba

+0

是的,這些只是特殊字符代碼(hexh值):http://webdesign.about.com/library/bl_htmlcodes.htm – spacebean