Broo
Broo

Reputation: 869

What is character 0x1f?

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

Upvotes: 22

Views: 95740

Answers (3)

jinbin feng
jinbin feng

Reputation: 41

Use Nodepad++ you will find the "Unit separator".

Like the picture:

enter image description here

Upvotes: 2

phihag
phihag

Reputation: 288298

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.

Upvotes: 27

valo
valo

Reputation: 1752

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/

Upvotes: 15

Related Questions