首页 > 移动平台 > 详细

Android string.xml error: Apostrophe not preceded by \

时间:2016-01-29 16:00:07      阅读:288      评论:0      收藏:0      [点我收藏+]

Android string.xml error: Apostrophe not preceded by \ 

遇到了这个错误,编译无法通过 error: Apostrophe not preceded by \ 

错误的代码是:

   <string name="security_protocol_dialog_content_1_msg">Restoring factory settings, the system will erase the phone‘s data without warning.</string>

正确的代码是:

   <string name="security_protocol_dialog_content_1_msg">Restoring factory settings, the system will erase the phone\‘s data without warning.</string>

额外加了一个转义字符(\)

当字符串中包含单引号(‘)的时候,就需要转义字符进行转义。

XML中的特殊字符:

单引号   ‘      ‘
双引号   "     "
大于号   >    >
小于号   <    <
与          &   &

  

Android string.xml error: Apostrophe not preceded by \

原文:http://www.cnblogs.com/zhou-guobao/p/5168776.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!