Urldecode不会解码HTML中的内部文本

时间:2013-08-09 11:24:18

标签: html utf-8 utf8-decode innertext

我有一些编码信息:

%3Ctable%20align%3D%22left%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20valign%3D%22top%22%20width%3D%2216%22%3E%3Cdiv%20class%3D%22query-color%22%20style%3D%22background-color%3A%238c2b2b%22%3E%26nbsp%3B%3C/div%3E%3C/td%3E%3Ctd%20class%3D%22label%22%20valign%3D%22top%22%3E%u05DB%u05E4%u05E8%20%u05E1%u05D1%u05D0%3C/td%3E%3Ctd%20valign%3D%22top%22%20width%3D%2216%22%3E%3Cdiv%20class%3D%22query-color%22%20style%3D%22background-color%3A%23468c2b%22%3E%26nbsp%3B%3C/div%3E%3C/td%3E%3Ctd%20class%3D%22label%22%20valign%3D%22top%22%3E%u05E0%u05EA%u05E0%u05D9%u05D4%3C/td%3E%3Ctd%20valign%3D%22top%22%20width%3D%2216%22%3E%3Cdiv%20class%3D%22query-color%22%20style%3D%22background-color%3A%232b5d8c%22%3E%26nbsp%3B%3C/div%3E%3C/td%3E%3Ctd%20class%3D%22label%22%20valign%3D%22top%22%3E%u05E4%u05EA%u05D7%20%u05EA%u05E7%u05D5%u05D5%u05D4%3C/td%3E%3Ctd%20valign%3D%22top%22%20width%3D%2216%22%3E%3Cdiv%20class%3D%22query-color%22%20style%3D%22background-color%3A%23cd5200%22%3E%26nbsp%3B%3C/div%3E%3C/td%3E%3Ctd%20class%3D%22label%22%20valign%3D%22top%22%3E%u05E8%u05D0%u05E9%u05D5%u05DF%20%u05DC%u05E6%u05D9%u05D5%u05DF%3C/td%3E%3Ctd%20valign%3D%22top

... ...

我用这一行来解码它:

urldecode(string);

我得到的html解码很好,但标签内的文字仍然是相同的:

<table align="left" cellpadding="0" cellspacing="0"><tbody><tr><td valign="top" width="16"><div class="query-color" style="background-color:#8c2b2b">&nbsp;</div></td><td class="label" valign="top">%u05DB%u05E4%u05E8 %u05E1%u05D1%u05D0</td><td valign="top" width="16"><div class="query-color" style="background-color:#468c2b">&nbsp;</div></td><td class="label" valign="top">%u05E0%u05EA%u05E0%u05D9%u05D4</td><td valign="top" width="16"><div class="query-color" style="background-color:#2b5d8c">&nbsp;</div></td><td class="label" valign="top">%u05E4%u05EA%u05D7 %u05EA%u05E7%u05D5%u05D5%u05D4</td><td valign="top" width="16"><div class="query-color" style="background-color:#cd5200">&nbsp;</div></td><td class="label" valign="top">%u05E8%u05D0%u05E9%u05D5%u05DF %u05DC%u05E6%u05D9%u05D5%u05DF</td><td valign="top" width="16"><div class="query-color" style="background-color:#e6bf00">&nbsp;</div></td><td class="label" valign="top">%u05E8%u05DE%u05EA %u05D2%u05DF</td><td valign="top" width="16"><div class="query-color" style="background-color:#7f3acd">&nbsp;</div></td><td class="label" valign="top">%u05E8%u05DE%u05EA 

我也试过

utf8_decode(urldecode(string)); 

因为文字是utf-8(我认为)

但它没有改变一件事。 有没有办法解决这个问题?

0 个答案:

没有答案