How do I escape unicode character 0x1F in xml?

后端 未结 2 431
执笔经年
执笔经年 2020-12-18 22:08

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?<

2条回答
  •  北海茫月
    2020-12-18 22:49

    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.

提交回复
热议问题