Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...