How to write a special symbol.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By usurun

How to write a special symbol like :clubs: or :diamonds: in a string.

:bust_in_silhouette: Reply From: Niranjan
Use this
for spade:  '\u2660',
for heart: '\u2661',
for club:   '\u2663',
for diamond: '\u2662',
example print("Heart", '\u2661')

Thanks, it seems it works by printing in the console, but still can not do it on a text label and I have tried many fonts.

usurun | 2019-09-11 15:11

If you’re on Windows, this bug is likely caused by different character encoding handling.

Calinou | 2019-09-11 17:04