How to convert string with emoji, convert emoji to string like this url with regex
<p>How to convert string with emoji ❤️, convert emoji to string like this question url <code>%EF%B8%8F</code> with regex? </p>

<pre><code>function emojitourl(str) {

return str;
}


var str = 'Thats a  ';
console.log( emojitourl(str) ); // Thats a ??
</code></pre>