android - eclipse 前面没有撇号

标签 android xml eclipse

我的项目中有许多字符串,其中包括没有反斜杠的撇号 ('),并且没有任何问题,直到我添加了另一个恰好有撇号的字符串并且我收到了

<string name="sec_fourth_para">The WRX\’s previous 2.0 liter engine was replaced with the 2.5 liter boxer engine.</string>

错误:撇号未由\

进行

我已经添加了\,但我仍然收到错误消息。搜索会出现一个类似的帖子,指出\将解决这个问题。除了停止使用 Eclipse 之外,还有其他建议吗?

最佳答案

根据此表:HTML codes

使用撇号代码'(',单引号)

<string name="sec_fourth_para">The WRX&#39;s previous 2.0 liter engine was replaced with the 2.5 liter boxer engine.</string>

(',右单引号)

<string name="sec_fourth_para">The WRX&#8217;s previous 2.0 liter engine was replaced with the 2.5 liter boxer engine.</string>

我推荐使用html代码,例如我使用©版权标志,那么我的字符串必须是:

<string name="copyright_ap">&#169; Copyright</string>

关于android - eclipse 前面没有撇号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21634030/

相关文章:

java - IOException:尝试使用休息服务时出现内部服务器错误

java - 转换 XML => JSON => 基于 XSD 模式的 XML

java - 无法将 .xslt 编译成 java 类文件

Java Logger 为每条消息添加前缀?

css - 如何将 CSS 文件连接到存储在 Web 内容(动态 Web 元素)中的 JSP 页面

android - 谁能帮助我开始使用 estimote beacons 示例 android 代码?

java - Android应用程序使用webview - 触发设备事件或电话调用

java.lang.ClassCastException 适配器转换为 Activity

css - 如何使用 CSS 在元素前插入文本?

java - 将代码块保存在变量中