1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
662 views
by michael-h-5027 (14.8k points)
I have an xml file that has non-utf-8 characters so I get an error when I try to format the xml.

1 Answer

0 votes

You can use a regexp website to find any non utf8 characters using the below example.

/[^\x00-\x7F]/g

Code example of how to use the regex:

var tempMessage = String(message.getNode('/'));
var newMessage = tempMessage.replace(/[^\x00-\x7F]/g, '');
message.setNode('/', newMessage);

by michael-h-5027 (14.8k points)
edited by brandon-w-8204
...