Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Decode Encoded String

I have a box that looks like this 🟩. I am trying to put it into a string like this

var t = "🟩"

but whenever I try to do that, it automatically gets encoded into something that looks like this 🟩

Here is my code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<div id="green" style="display: none;">🟩</div>

Should Be

<div id="green" style="display: none;">🟩</div>

How do I decode it? (This code is being uploaded to chrome://extensions if that helps. Thats why its changing I think)

>Solution :

Add <meta charset="UTF-8"> to the head tag.

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
</head>
<body>
  <div id="green">🟩</div>
</body>
</html>

Also why have you set display to none?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading