node.js and xmlbuilder – error on invalid characters or emoticons

Xml builder has problem with emoticons or “invalid” characters (e.g. x\ u\ e.g. u\0007 – Bell or another characters mentioned by xml specifications). If You don’t apply xml parser to detect invalid characters then instance of node.js server can be crushed. During parsing you will have got error like following [“uncaughtException::catchError Error: Invalid character (\u0007) in string: Remember about meeting \u0007/1 at index 36”].

With problem related with invalid characters You can have chance to touch it in case of text-rich editors, when You try convert plain-text to xml.

For avoid this problems we have two very simple solutions:

emoticons: You have to place in create function of xmlbuilder parameter like on below screen

invalid characters (let’s say not acceptable by xml standard) – to solve this issue please use defined by me function which works on regex

The whole source code is following on production environment

April 27th, 2017

  • I wanted to send you that very small note to give many thanks as before on the extraordinary opinions you have contributed on this site. This is certainly pretty generous with you to grant without restraint just what most of us would have distributed for an ebook to help make some bucks on their own, especially given that you could have done it in case you desired. The basics in addition acted to become fantastic way to be certain that other individuals have the same dreams much like mine to know much more with respect to this issue. Certainly there are thousands of more pleasurable instances ahead for folks who look over your website..

  • I am only writing to let you be aware of what a wonderful experience my friend’s girl undergone reading your blog. She realized a good number of pieces, not to mention how it is like to possess an amazing giving style to make folks quite simply fully grasp several extremely tough subject areas. You undoubtedly surpassed her desires. Many thanks for producing these beneficial, safe, informative and in addition cool tips about that topic to Sandra..

  • I and also my guys were actually digesting the nice solutions from the website while immediately I had an awful feeling I had not thanked the site owner for them. These people happened to be as a result happy to see all of them and already have pretty much been taking pleasure in those things. We appreciate you actually being very helpful and then for picking out some magnificent information millions of individuals are really needing to learn about. My sincere apologies for not saying thanks to sooner..