XML 中的转义方形字符
我创建了一个包含“²”字符的 XML 文件。在 Internet Explorer 中查看文档时,出现“无效字符”错误。是否需要以某种方式转义?或者这只是 IE8 的问题。 XML 的实际部分如下所示:
<Text>ATTENTION INVESTORS & DEVELOPERS
920m² freehold site on 2 titles consisting of vacant land and adjoining buildings. Located within the CBD this is one of the last sites available with frontages on both Marine Parade and Hastings Street, Napier. Zoned inner city commercial.
Contact agents for details.
</Text>
I've created an XML file that contains the "²" character. When viewing the document in Internet Explorer, I get an "Invalid Character" error. Does ² need to be escaped somehow? or is this just an issue with IE8. The actual bit of XML is shown below:
<Text>ATTENTION INVESTORS & DEVELOPERS
920m² freehold site on 2 titles consisting of vacant land and adjoining buildings. Located within the CBD this is one of the last sites available with frontages on both Marine Parade and Hastings Street, Napier. Zoned inner city commercial.
Contact agents for details.
</Text>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够使用 HTML 实体样式引用(就像您对
&
所做的那样)。我认为
²
或²
应该可以。此处查看编码列表。
You should be able to use an HTML entity-style reference (like you did with
&
).I think
²
or²
should work.Take a look at the list of encodings here.