开发者

Is CDATA supposed to be URL-encoded?

开发者 https://www.devze.com 2023-01-20 17:27 出处:网络
Obviously the answer is no... right? The reason I ask is because I have this string defined in XML for an Android app:

Obviously the answer is no... right? The reason I ask is because I have this string defined in XML for an Android app:

<string name="foo"><![CDATA[<html><body><p>This%20is%20开发者_运维问答a%20test</p></body></html>]]></string>

All I do to the string is read it, and display in an HTML view. I would not have expected the %20s to be interpreted, yet they are. Is this the correct behaviour, or is Android being typically buggy?


Is CDATA supposed to be URL-encoded?

No. The only rule of CDATA is that it can't contain a closing CDATA ]]> - everything else is fair game.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号