How to replace non-printable unicode characters (Javascript)

后端 未结 2 2045
感动是毒
感动是毒 2020-12-01 08:25

I\'ve already wasted a good amount of time dealing with strings (generated by some other source) and I found out that the problem was that the strings have non-printable cha

2条回答
  •  没有蜡笔的小新
    2020-12-01 08:54

    Best practice seems to dictate that you specify what you WILL accept (the white-list approach), rather than trying to filter out what you WON'T accept (the black-list approach).

    This is a similar question, although the answers are not comprehensive.

提交回复
热议问题