1

I have a console application which is displaying special symbols like

☢ ☍ ⌘ ✰ ⣿ ⚡ ☯ ⚑  ↺  ⤴  ⤵

No matter where - putty(UTF8+Use Unicode line drawing, but I guess it's not client issue), local console, SecureCRT - I can't see them. Instead just squares. Here is my shell env variables

LANG=en_US.UTF-8
TERM=xterm

Any idea how to make terminal to show those symbols correctly?

Update

Glyph I am interested in

python -c 'print u"\u22c5 \u22c5\u22c5 \u201d \u2019 \u266f \u2622 \u260d \u2318 \u2730 " \
    u"\u28ff \u26a1 \u262f \u2691 \u21ba \u2934 \u2935 \u2206 \u231a \u2240\u2207 \u2707 " \
    u"\u26a0\xa0\u25d4 \u26a1\xa0\u21af \xbf \u2a02 \u2716 \u21e3 \u21e1  \u2801 \u2809 " \
    u"\u280b \u281b \u281f \u283f \u287f \u28ff \u2639 \u2780 \u2781 \u2782 \u2783 \u2784 " \
    u"\u2785 \u2786 \u2787 \u2788 \u2789 \u25b9\xa0\u254d \u25aa \u26af \u2692 \u25cc " \
    u"\u21c5 \u21a1 \u219f \u229b \u267a ".encode("utf8")'

Screenshot with Ubuntu font

enter image description here

Screenshot with DejaVu font

enter image description here

Pablo
  • 2,597

3 Answers3

3

I just copied the characters from your example and echoed them in a terminal window:

UTF-8 Characters test in GNOME Terminal

I guess TTYs do not have that much character support, so it could be a font issue.

lgarzo
  • 20,492
0

I support @lgarzo. You may try some bigger fonts, especially oriental ones:

$ aptitude install ttf-wqy-microhei
WIZARDELF
  • 200
0

... putty(UTF8+Use Unicode ...

Rather than using a hex escape sequence, it maybe easier to use the actual characters to test for resident fonts (if a character is missing this is an oxymoron since it will not be possible to choose it! - which means a source machine must create a file with the desired symbols in it and then display that file with the target machine).

Programmed glyph generation can also be done using character/UTF pairings of unicodes by extraction of UTF-8 or UTF-16:

    python -c 'print "⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚"'
    ⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚

    python -c 'print "⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚".decode("unicode_escape")'
    â Ⱐ⣿ ⡠⯠â ⺠⤴ ⤵ â â

    python -c 'print "⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚".decode("unicode_escape")
                                                   .encode("unicode_escape")'
    \xe2\x8c\x98 \xe2\x9c\xb0 \xe2\xa3\xbf \xe2\x9a\xa1 \xe2\x98\xaf \xe2\x9a\x91
    \xe2\x86\xba \xe2\xa4\xb4 \xe2\xa4\xb5 \xe2\x88\x86 \xe2\x8c\x9a

    python -c 'print "⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚".decode("unicode_escape")
                                                   .encode("unicode_escape")
                                                       .decode("string_escape")'
    ⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚

    python
    Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> u"⌘ ✰ ⣿ ⚡ ☯ ⚑ ↺ ⤴ ⤵ ∆ ⌚"
    u'\u2318 \u2730 \u28ff \u26a1 \u262f \u2691 \u21ba \u2934 \u2935 \u2206 \u231a'

Unicode glyphs can be rendered using UTF-8 or UTF-16
thus Unicode U+2318 or UTF-16: 0x2318 or is UTF-8: 0xE2 0x8C 0x98

Font details for a character can be found by literally searching for it in character map. It is run as an icon utility or activated with the gnome-character-map or gucharmap terminal command. Press and hold the right mouse button over the character to identify the font of residence. Also, use Show only glyphs in this font in the View menu and then scroll through the font list with an arrow key to quickly find the character's font with other resident characters.

enter image description here

oops
previous answer below reiterates the obvious - was looking at answers rather than question


ubuntu@ubuntu:~$ echo '☢ ☍ ⌘ ✰ ⣿ ⚡ ☯ ⚑  ↺  ⤴  ⤵'
☢ ☍ ⌘ ✰ ⣿ ⚡ ☯ ⚑  ↺  ⤴  ⤵

and

python -c 'print u"\xbf  \n FreeSerif\n"  \
  u"\u2019 \u201d \u219f \u21a1 \u21af \u21ba \u21c5 \u21e1 \u21e3 \n" \
  u"\u2206 \u2207 \u2240 \u229b \u22c5 \u22c5\u22c5 \u2318 \u231a \n"  \
  u"\u25aa \u25b9 \u25cc \u25d4 \n"   \
  u"\u260d \u2622 \u262f \u2639 \u266f \u267a \u2691 \u2692 \u26a0 \u26a1 \u26af \n" \
  u"\u2780 \u2781 \u2782 \u2783 \u2784 \u2785 \u2786 \u2787 \u2788 \u2789 \n"  \
  u"\u2707 \u2716 \u2730 \u2a02 \n DejaVu\n"   \
  u"\u2801 \u2809 \u280b \u281b \u281f \u283f \u287f \u28ff \n"  \
  u"\u2934 \u2935 \u254d   \n".encode("utf8")'

prints

¿  
 FreeSerif
’ ” ↟ ↡ ↯ ↺ ⇅ ⇡ ⇣ 
∆ ∇ ≀ ⊛ ⋅ ⋅⋅ ⌘ ⌚ 
▪ ▹ ◌ ◔ 
☍ ☢ ☯ ☹ ♯ ♺ ⚑ ⚒ ⚠ ⚡ ⚯ 
✇ ✖ ✰ ⨂ 
➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉ 
 DejaVu
⠁ ⠉ ⠋ ⠛ ⠟ ⠿ ⡿ ⣿ 
⤴ ⤵ ╍   

using gnome-terminal

ubuntu@ubuntu:~$ echo \$TERM = $TERM \  \$LANG = $LANG
$TERM = xterm   $LANG = en_US.UTF-8

and

ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04 LTS
Release:    12.04
Codename:   precise
ubuntu@ubuntu:~$ 

note: EOT and ENQ symbols are wrong
ref: How can unicode symbols u+2404 ␄ EOT and u+2405 ␅ ENQ be corrected?

python -c 'print u"This is ^D EOT (NB!! no ;) \u2404 and ENQ ^E \u2405 ".encode("utf8")'
This is ^D EOT (NB!! no ;) ␄ and ENQ ^E ␅