I have some strings like this(encoded as utf-8):
توسعه
.
I want to convert them to:
توسعه
How can I do that in javascript?
The solution needs to be compatible with nashorn, since I am running the code in a virtual engine in java.
NOTE: None of these HTML Entity Decode, Unescape HTML entities in Javascript? are acceptable for my question, since they do not work in nashorn.
P.S: I have searched for possible solutions, and it was suggested by many to use decodeURIComponent(escape(window.atob(yourString)))
(with slight differences), which apparently does not work, as I have tried them in vscode(javascript).