3

A week ago, 11 Aug 2019, I was able to render the characters in Visual Studio Code cmd console correctly without the �, but now 18 Aug 2019, the � is showing along side the emoji. How can I fix it?

// app.ts file
import * as emoji from 'node-emoji';

console.log(emoji.get('crossed_fingers'));
console.log(emoji.get('baby_bottle'));
console.log(emoji.get('beer'));
console.log(emoji.get('champagne'));

Console output

�
�
�
�

I tried Visual Studio Code 1.37.1 and also 1.36.1, on Windows 10, both give me same results. I didn't take note what version I was using last week. I also think it could be recent Windows Update causing the problem since there was no system change other then Windows Update version 1903 and Visual Studio Code Update, both happened automatically and on different laptops (home and work).

Jake
  • 11,273
  • 21
  • 90
  • 147
  • FYI, I just tried this on requirebin.com and got gibberish characters. – Cully Aug 19 '19 at 02:52
  • Works running from the console, using node, on macos. – Cully Aug 19 '19 at 02:58
  • @Cully are you using Visual Studio Code? It was working correctly then one day it just decided to print the � character in console. – Jake Aug 19 '19 at 03:01
  • It might be an issue with the font used by your console. Check this post: https://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using – Patrick Aug 19 '19 at 03:03
  • No, just using the terminal. Have you tried running directly from the terminal? It could be that your VSC terminal is using the wrong character encoding. – Cully Aug 19 '19 at 03:03
  • One other thing to try, `cat` the `node_modules/node-emoji/lib/emoji.json` file in the VSC terminal. See what that shows. `node-emoji` gets the emojis directly from that file. – Cully Aug 19 '19 at 03:04
  • The file is UTF-8 encoded, so if you see gibberish in the terminal, it's probably the character encoding/font in your terminal settings. – Cully Aug 19 '19 at 03:06
  • @Cully Thank you. I output to a .txt file and the funny characters are gone! OK, so that means the console character encoding is messed up. But I cannot think of any changes done, and the same problem occurs in all Bash, Powershell and CMD, overnight suddenly. – Jake Aug 19 '19 at 03:17

0 Answers0