I have some XML files in res/xml
and I'm trying to escape characters as you would normally do in XML. I tried nearly every way possible:
<tag>Okay, I'll do it</tag>
<tag>Okay, I\'ll do it</tag>
<tag>Okay, I'll do it</tag>
<tag>Okay, I'll do it</tag>
<tag>Okay, I'll do it</tag>
None of them work, when I parse the file with XmlPullParser
, I always get only part of the text: Okay I
, split where the apostrophe was.
I also tried parser.setFeature(Xml.FEATURE_RELAXED, true)
, as suggested here, without success.
Is there any reason to this or any to fix this behavior?
EDIT: After more testing, it looks like this issue only happens with the apostrophe and no other escaped characters like &
.