- Context: HTML web page (jade/node.js/javascript)
- image url has strings with spaces/non-ascii characters
- I need to encode these strings either with escape or urlencode.
- as of now I am using escape to encode spaces specifically.
But I am not able justify/understand whether I should use escape to encode strings or should I use encodeurlcomponent. I tried reading some online blogs but not understood yet.
Any pointers to which one should be used under what circumstances.