javascript - How to remove control characters from string? -


I have a form on my page where the user can write some text and submit it. The text is sent to the server (the REST API at the top of the node. JS) and is saved in DB (Postgrad).

The problem is that some strange characters (control characters) are saved on DB Opportunity - for example the escape control character (^ [] or backspace control character (^ H). Also, because these characters are invisible, so html is sung correctly. However, when I provide XML content for RSS readers, then they (the reader) will control those control characters (this works after removing them) Cause "Perverted XML"

My question is how can I remove those characters on the client level (javascript) or the server level (javascript / node.js) string?


Find me the correct answer here:

  s.replace (/ [\ X00- \ x1F \ x7F- \ x9F] / g, "");  
< / Div>

I had a similar problem, here is the solution that I choose.

I have encoded encryption User (variable_name) using the user String data is encoded and then I have been decoded decoded through encontant (variable) saved


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -