B
B
bozuriciyu2019-11-02 20:09:16
JavaScript
bozuriciyu, 2019-11-02 20:09:16

How to sanitize such lines?

How to remove all such characters? Some str\u0010ing
Here \u0010breaks my code

Error: Invalid character in string: Some str�ing at index 33
    at XMLStringifier.assertLegalChar (/home/.../node_modules/xmlbuilder/lib/XMLStringifier.js:208:19)

I understand that there can be a lot of them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Chuprik, 2019-11-02
@choupa

Pass the replacement by regular expression:
str.replace( /\\u\d{4}/, '')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question