I need to write a text with the unicode character 0x1F in a utf-8 document (it is not an allowed character in xml). Is there a way to escape it, or do I have to discard it?<
This will do it in XML 1.1 (but is discouraged):
It isn't supported at all in XML 1.0. A workaround is to base-64 encode the text containing the character.