Most likely, you are best off finding a server-side solution, as mentioned in the comments, as this seems like a server issue.
If for some reason you want to make this client side, here is the solution:
var str = "<span%20style='color:green;font-weight:bold'>%20Text%20Msg</span>"; var fixedStr = decodeURIComponent(str).replace(/</g,'<').replace(/>/g,'>');
source share