CDATA 应该是 URL 编码的吗?
显然答案是否定的……对吗?我之所以问这个问题,是因为我在 Android 应用程序的 XML 中定义了这个字符串:
<string name="foo"><![CDATA[<html><body><p>This%20is%20a%20test</p></body></html>]]></string>
我对该字符串所做的只是读取它,并在 HTML 视图中显示。我不会期望%20
会被解释,但它们确实被解释了。这是正确的行为,还是 Android 通常存在错误?
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%20a%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 %20
s to be interpreted, yet they are. Is this the correct behaviour, or is Android being typically buggy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
否。 CDATA 的唯一规则是它不能包含结束 CDATA
]]>
- 其他一切都是公平的游戏。No. The only rule of CDATA is that it can't contain a closing CDATA
]]>
- everything else is fair game.