Mr Brickstar
Mr Brickstar

Reputation: 308

express.js emojis are not displayed

Im currently trying to develope a express webserver. The server sends a site with emojis, but the emojis are just shown as ??. Code:

send = send + "<div id='Website'>🌐 <a href='"+webseite+"'>Website</a></div>"

And it looks like this:

?? Website

Any way to fix this?

Upvotes: 0

Views: 894

Answers (2)

WoW HACK
WoW HACK

Reputation: 21

I know it is late but it might help others you can set charset to UTF-8 for example:

app.get('/', (req, res) => {
  res.writeHead(200, {'content-type': 'text/html; charset=utf-8'});
  res.end(" 🚀 ");
});

Upvotes: 0

Jonathan Delean
Jonathan Delean

Reputation: 1084

If you you NodeJS with express, you can use :

https://www.npmjs.com/package/node-emoji

Il will stringify your emoji

Upvotes: 1

Related Questions