I've just imported a chunk of text into a string element for a book app and I'm getting this error : An invalid XML character (Unicode:0x1f) was found in the element content of this document. I looked it up here http://lwp.interglacial.com/appf_01.htm and the description says US (removing underlining doesnt seem to work). What is this character so I can remove it if possible. I'm very new to android so simple answers please :)
0x1f is a Unit Separator, an archaic way to separate fields in a text (Like , or Tab in CSV). It is indeed not a valid text character in XML 1.0 (but allowed in XML 1.1). In a UTF-8 input string, you can also safely replace the byte 0x1f with 0x09 (Tab) to work around the problem.
hexadecimal value 0x1F, is an invalid character.
Unicode 0x2 is 'Start of Text', which is represented as  .
0x1f is a Unit Separator, an archaic way to separate fields in a text (Like ,
or Tab
in CSV).
It is indeed not a valid text character in XML 1.0 (but allowed in XML 1.1). In a UTF-8 input string, you can also safely replace the byte 0x1f
with 0x09
(Tab) to work around the problem. Alternatively, declare the document as XML 1.1 and use an XML 1.1 parser.
US means "Unit separator". This is an invisible character, so you should open your text file with some text editor that can show the invisible characters and remove them. I think that probably Notepad++ will give you this functionality:
http://notepad-plus-plus.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With