Unicode character 0x1 not being removed

安稳与你 提交于 2020-05-02 04:31:05

问题


I have the following code in order to remove ALL invalid Unicode characters before sending them in XML in a SOAP request.

const invalidUnicodeRemoved = inputText.replace(/[\u0000-\u001F]/gm, '');

However, I keep getting the following error sending the XML: An invalid XML character (Unicode: 0x1) was found in the element content of the document.. So basically it has not been removed (or at least not all of them).

Any ideas?

来源:https://stackoverflow.com/questions/45009271/unicode-character-0x1-not-being-removed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!