Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is character 0x1f?

Tags:

android

xml

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 :)

like image 311
Broo Avatar asked Jul 14 '11 12:07

Broo


People also ask

What does 0x1F mean?

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.

What is hexadecimal value 0x1F?

hexadecimal value 0x1F, is an invalid character.

What is 0x2 character?

Unicode 0x2 is 'Start of Text', which is represented as  .


2 Answers

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.

like image 115
phihag Avatar answered Oct 18 '22 02:10

phihag


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/

like image 15
valo Avatar answered Oct 18 '22 02:10

valo