pythonintellij-ideaconsoleemoji

How to add Unicode emoji to python script in IntelliJ


I have a script which I have created couple of months ago with an older version of Intellij + Python plugin. I had to migrate to new windows and also new IntelliJ Currently I am using :

I was using 3 colors of emojis to enhance my logs: 🟪 🟦 🟩

After migration I have realized that neither the python code shows the icons as before, neither the logs are representing those icons in the desired colors. The simplified code looks like:

if __name__ == "__main__":
  
    print("This is a normal print statement", file=sys.stdout)
    print(f"🟪 this was purple")
    print(f"🟦 this was blue")
    print(f"🟩 this was green")

and In IntelliJ it shows : enter image description here

After running the code the output looks:

enter image description here

How to see the real colors of those emojis in my python script and how to output them correctly to the console output?


Solution

  • It might help to set an Emoji font as fallback font (Settings → Editor → Font → Typography Settings → Fallback font) in the IDE to fix the missing/misrepresented emojis: