This page looks best with JavaScript enabled

URxvt UTF-8 FreeBSD

 ·  🎃 kr0m

In this article we will explain how to configure FreeBSD for a Spanish keyboard layout with UTF-8 support under URxvt. This may seem simple, but it can be quite tricky if not configured correctly.

We will also give a couple of useful tips to ensure that certain tools such as htop or the well-known media player MOC display correct output in the console.

The first step will be to configure the keyboard layout at the operating system level in the rc.conf file:

vi /etc/rc.conf

keymap="es.kbd"

Then we will continue with the configuration at the X level in the xinitrc file:

vi ~/.xinitrc

export LANG=es_ES.UTF-8  
export LC_ALL=es_ES.UTF-8  
setxkbmap es  
xrdb .Xresources  
  
xbindkeys &  
export SSH_ASKPASS=/usr/local/bin/x11-ssh-askpass ;export SSH_ASKPASS  
eval `ssh-agent -s`  
ssh-add &  
compton -b -i 1 --vsync opengl --sw-opti --backend glx --glx-no-stencil -D 0 -m 1  
shutter --min_at_startup &  
nextcloud &  
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome

We install the URxvt terminal and Perl extensions:

pkg install rxvt-unicode urxvt-perls

Finally, we configure our terminal using the Xresources file:

vi ~/.Xresources

Xcursor.theme:    Vanilla-DMZ-AA  
!Xcursor.core: 1  
!Xcursor.theme: default  
!urxvt color scheme:  
  
xterm*termName: xterm-256color  
  
  
URxvt.transparent:  false  
URxvt.background: Black  
URxvt.foreground: White  
URxvt.colorUL: #86a2b0  
URxvt.underlineColor:  Yellow  
  
!urxvt fonts:  
URxvt.font: xft:Dejavu Sans Mono:pixelsize=13:antialias=true  
URxvt.boldFont: xft:Dejavu Sans Mono:pixelsize=13:antialias=true:style=bold  
  
  
URxvt.letterSpace: -1  
  
URxvt.utf8:               1  
URxvt.termName: rxvt-unicode  
URxvt.imLocale: es_ES.UTF-8  
  
Xft.dpi: 96  
Xft.antialias: true  
Xft.hinting: true  
Xft.rgba: rgb  
Xft.autohint: false  
Xft.hintstyle: hintslight  
Xft.lcdfilter: lcddefault  
  
!enabling clickable links:  
URxvt.urlLauncher:      /usr/local/bin/chrome  
URxvt.matcher.button:   1  
  
!urxvt scrolling options and cursor style:  
URxvt.saveLines: 655350  
URxvt.scrollstyle: rxvt  
URxvt.scrollBar: false  
URxvt.cursorBlink: true  
URxvt.cursorUnderline: true  
  
URxvt.scrollTtyOutput:      false  
URxvt.scrollWithBuffer:     true  
URxvt.scrollTtyKeypress:    true  
  
!Cut charis  
URxvt.cutchars: `()*<>[]{|}:  
  
! urxvt tabs settings:  
URxvt.tabbed.tabbar-fg: 2  
URxvt.tabbed.tabbar-bg: 0  
URxvt.tabbed.tab-fg: 2  
URxvt.tabbed.tab-bg: 8  
URxvt.tabbed.autohide:  yes  
URxvt.tabbed.new-button:  no  
URxvt.tabbed.title: no  
  
URxvt.keysym.Control-m: perl:kr0m:mysqlSlave  
URxvt.keysym.Control-n: perl:kr0m:mysqlRepUsers  
URxvt.keysym.Control-h: perl:kr0m:iptables  
URxvt.keysym.Control-j: perl:kr0m:ss  
URxvt.keysym.Control-o: perl:kr0m:clearcomments  
URxvt.keysym.Control-p: perl:kr0m:psaux  
URxvt.keysym.Control-i: perl:kr0m:icanhazip  
URxvt.keysym.Control-u: perl:kr0m:pass  
  
URxvt.iso14755: False  
URxvt.perl-ext-common: default,kr0m,searchable-scrollback,theme  
URxvt.searchable-scrollback: Control-s  
  
! xpdf  
xpdf.initalZoom:    width  
xpdf.reverseVideo:  true  
xpdf.toolTipEnable: false  
  
! xterm  
xterm*autoWrap:        true  
xterm*faceName:        xft:bitstream vera sans mono:size=15:antialias=true  
xterm*metaSendsEscape: true  
  
!! xterm colors  
! normal  
xterm*color0:  #000000  
xterm*color1:  #B40000  
xterm*color2:  #00AA00  
xterm*color3:  #AAAA00  
xterm*color4:  #5555AA  
xterm*color5:  #CC00CC  
xterm*color6:  #00AAAA  
xterm*color7:  #AAAAAA  
! bright (bold)  
xterm*color8:  #555555  
xterm*color9:  #FFF000  
xterm*color10: #00DD00  
xterm*color11: #FFFF00  
xterm*color12: #6464FF  
xterm*color13: #FF00FF  
xterm*color14: #00EEEE  
xterm*color15: #DDDDDD  
! misc  
xterm*foreground:  #00AA00  
xterm*background:  #000000  
xterm*cursorColor: #00AA00  
  
! Urxvt themes  
URxvt.theme.Solarized.background: #fdf6e3  
URxvt.theme.Solarized.foreground: #657b83  
URxvt.theme.Solarized.color0: #073642  
URxvt.theme.Solarized.color15: #fdf6e3

We restart to ensure that all the configuration we have done is loaded and check that we can see the characters in this demo file:

We should see output similar to this:

UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY


The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.


Using Unicode/UTF-8, you can write in emails and source code things such as

Mathematics and sciences:

  ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫
                                            ⎪⎢⎜│a²+b³ ⎟⎥⎪
  ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),    ⎪⎢⎜│───── ⎟⎥⎪
                                            ⎪⎢⎜⎷ c₈   ⎟⎥⎪
  ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ,                   ⎨⎢⎜       ⎟⎥⎬
                                            ⎪⎢⎜ ∞     ⎟⎥⎪
  ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫),      ⎪⎢⎜ ⎲     ⎟⎥⎪
                                            ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
  2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm     ⎩⎣⎝i=1    ⎠⎦⎭

Linguistics and dictionaries:

  ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
  Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]

APL:

  ((V⍳V)=⍳⍴V)/V←,V    ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈

Nicer typography in plain text files:

  ╔══════════════════════════════════════════╗
  ║                                          ║
  ║   • ‘single’ and “double” quotes         ║
  ║                                          ║
  ║   • Curly apostrophes: “We’ve been here” ║
  ║                                          ║
  ║   • Latin-1 apostrophe and accents: '´`  ║
  ║                                          ║
  ║   • ‚deutsche‘ „Anführungszeichen“       ║
  ║                                          ║
  ║   • †, ‡, ‰, •, 3–4, —, −5/+5, ™, …      ║
  ║                                          ║
  ║   • ASCII safety test: 1lI|, 0OD, 8B     ║
  ║                      ╭─────────╮         ║
  ║   • the euro symbol: │ 14.95 € │         ║
  ║                      ╰─────────╯         ║
  ╚══════════════════════════════════════════╝

Combining characters:

  STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑

Greek (in Polytonic):

  The Greek anthem:

  Σὲ γνωρίζω ἀπὸ τὴν κόψη
  τοῦ σπαθιοῦ τὴν τρομερή,
  σὲ γνωρίζω ἀπὸ τὴν ὄψη
  ποὺ μὲ βία μετράει τὴ γῆ.

  ᾿Απ᾿ τὰ κόκκαλα βγαλμένη
  τῶν ῾Ελλήνων τὰ ἱερά
  καὶ σὰν πρῶτα ἀνδρειωμένη
  χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!

  From a speech of Demosthenes in the 4th century BC:

  Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
  ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
  λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
  τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
  εἰς τοῦτο προήκοντα,  ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
  πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
  οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
  οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
  ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
  τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
  γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
  προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
  σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
  τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
  τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
  τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.

  Δημοσθένους, Γ´ ᾿Ολυνθιακὸς

Georgian:

  From a Unicode conference invitation:

  გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
  კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
  ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
  ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
  ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
  ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
  ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.

Russian:

  From a Unicode conference invitation:

  Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
  Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
  Конференция соберет широкий круг экспертов по  вопросам глобального
  Интернета и Unicode, локализации и интернационализации, воплощению и
  применению Unicode в различных операционных системах и программных
  приложениях, шрифтах, верстке и многоязычных компьютерных системах.

Thai (UCS Level 2):

  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
  classic 'San Gua'):

  [----------------------------|------------------------]
    ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช  พระปกเกศกองบู๊กู้ขึ้นใหม่
  สิบสองกษัตริย์ก่อนหน้าแลถัดไป       สององค์ไซร้โง่เขลาเบาปัญญา
    ทรงนับถือขันทีเป็นที่พึ่ง           บ้านเมืองจึงวิปริตเป็นนักหนา
  โฮจิ๋นเรียกทัพทั่วหัวเมืองมา         หมายจะฆ่ามดชั่วตัวสำคัญ
    เหมือนขับไสไล่เสือจากเคหา      รับหมาป่าเข้ามาเลยอาสัญ
  ฝ่ายอ้องอุ้นยุแยกให้แตกกัน          ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
    พลันลิฉุยกุยกีกลับก่อเหตุ          ช่างอาเพศจริงหนาฟ้าร้องไห้
  ต้องรบราฆ่าฟันจนบรรลัย           ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ

  (The above is a two-column text. If combining characters are handled
  correctly, the lines of the second column should be aligned with the
  | character above.)

Ethiopian:

  Proverbs in the Amharic language:

  ሰማይ አይታረስ ንጉሥ አይከሰስ።
  ብላ ካለኝ እንደአባቴ በቆመጠኝ።
  ጌጥ ያለቤቱ ቁምጥና ነው።
  ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
  የአፍ ወለምታ በቅቤ አይታሽም።
  አይጥ በበላ ዳዋ ተመታ።
  ሲተረጉሙ ይደረግሙ።
  ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
  ድር ቢያብር አንበሳ ያስር።
  ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
  እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
  የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
  ሥራ ከመፍታት ልጄን ላፋታት።
  ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
  የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
  ተንጋሎ ቢተፉ ተመልሶ ባፉ።
  ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
  እግርህን በፍራሽህ ልክ ዘርጋ።

Runes:

  ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ

  (Old English, which transcribed into Latin reads 'He cwaeth that he
  bude thaem lande northweardum with tha Westsae.' and means 'He said
  that he lived in the northern land near the Western Sea.')

Braille:

  ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌

  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
  ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
  ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
  ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
  ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
  ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲

  ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲

  ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
  ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
  ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
  ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
  ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
  ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
  ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
  ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲

  (The first couple of paragraphs of "A Christmas Carol" by Dickens)

Compact font selection example text:

  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
  abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
  –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
  ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა

Greetings in various languages:

  Hello world, Καλημέρα κόσμε, コンニチハ

Box drawing alignment tests:                                          █
                                                                      ▉
  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳
  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳
  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳
  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎
  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏
  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█
                                               ▝▀▘▙▄▟

NOTE: As we can see, there are still some symbols that fail, such as runes, but we will be covered in most cases.

However, if it does not work, we will get the following output:

UTF-8 encoded sample plain-text file
â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾â¾

Markus Kuhn [ËmaʳkÊs kuËn] <http://www.cl.cam.ac.uk/~mgk25/> â 2002-07-25 CC BY


The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.


Using Unicode/UTF-8, you can write in emails and source code things such as

Mathematics and sciences:

  â® Eâda = Q,  n â â, â f(i) = â g(i),      â§â¡ââââââââââ¤â«
                                            âªâ¢ââa²+b³ ââ¥âª
  âxââ: âxâ = âââxâ, α ⧠¬β = ¬(¬α ⨠β),    âªâ¢âââââââ ââ¥âª
                                            âªâ¢ââ· câ   ââ¥âª
  â â ââ â ⤠â â â â â â,                   â¨â¢â       ââ¥â¬
                                            âªâ¢â â     ââ¥âª
  ⥠< a â  b â¡ c ⤠d ⪠⤠â (â¦A⧠â âªBâ«),      âªâ¢â â²     ââ¥âª
                                            âªâ¢â â³aâ±-bâ±ââ¥âª
  2Hâ + Oâ â 2HâO, R = 4.7 kΩ, â 200 mm     â©â£âi=1    â â¦â­

Linguistics and dictionaries:

  ði ıntÉËnæÊÉnÉl fÉËnÉtık ÉsoÊsiËeıÊn
  Y [ËÊpsilÉn], Yen [jÉn], Yoga [ËjoËgÉ]

APL:

  ((Vâ³V)=â³â´V)/Vâ,V    â·ââ³ââ´ââââ¾âââ

Nicer typography in plain text files:

  ââââââââââââââââââââââââââââââââââââââââââââ
  â                                          â
  â   ⢠âsingleâ and âdoubleâ quotes         â
  â                                          â
  â   ⢠Curly apostrophes: âWeâve been hereâ â
  â                                          â
  â   ⢠Latin-1 apostrophe and accents: '´`  â
  â                                          â
  â   ⢠âdeutscheâ âAnführungszeichenâ       â
  â                                          â
  â   ⢠â , â¡, â°, â¢, 3â4, â, â5/+5, â¢, ⦠     â
  â                                          â
  â   ⢠ASCII safety test: 1lI|, 0OD, 8B     â
  â                      â­ââââââââââ®         â
  â   ⢠the euro symbol: â 14.95 â¬ â         â
  â                      â°âââââââââ⯠        â
  ââââââââââââââââââââââââââââââââââââââââââââ

Combining characters:

  STARGÎÌTE SG-1, a = vÌ = rÌ, aâ ⥠bâ

Greek (in Polytonic):

  The Greek anthem:

  Σὲ γνÏÏá½·Î¶Ï á¼Ïὸ Ïὴν κόÏη
  Ïοῦ ÏÏαθιοῦ Ïὴν ÏÏομεÏá½µ,
  Ïá½² γνÏÏá½·Î¶Ï á¼Ïὸ Ïὴν á½Ïη
  Ïοὺ μὲ βία μεÏÏάει Ïá½´ γá¿.

  ᾿ÎÏ᾿ Ïá½° κόκκαλα βγαλμένη
  Ïῶν ῾ÎλλήνÏν Ïá½° ἱεÏá½±
  καὶ Ïὰν ÏÏῶÏα á¼Î½Î´ÏειÏμένη
  Ïαá¿Ïε, ὦ Ïαá¿Ïε, ᾿ÎλεÏθεÏιά!

  From a speech of Demosthenes in the 4th century BC:

  Îá½Ïὶ Ïαá½Ïá½° ÏαÏá½·ÏÏαÏαί μοι γιγνώÏκειν, ὦ á¼Î½Î´ÏÎµÏ á¾¿Îθηναá¿Î¿Î¹,
  á½Ïαν Ï᾿ Îµá¼°Ï Ïá½° ÏÏάγμαÏα á¼ÏοβλέÏÏ ÎºÎ±á½¶ á½Ïαν ÏÏá½¸Ï ÏοὺÏ
  λόγοÏÏ Î¿á½Ï á¼ÎºÎ¿á½»ÏÎ ÏÎ¿á½ºÏ Î¼á½²Î½ Î³á½°Ï Î»á½¹Î³Î¿ÏÏ ÏεÏὶ Ïοῦ
  ÏιμÏÏá½µÏαÏθαι ΦίλιÏÏον á½Ïῶ γιγνομένοÏÏ, Ïá½° δὲ ÏÏάγμαÏ᾿
  Îµá¼°Ï ÏοῦÏο ÏÏοήκονÏα,  á½¥Ïθ᾿ á½ÏÏÏ Î¼á½´ ÏειÏόμεθ᾿ αá½Ïοὶ
  ÏÏá½¹ÏεÏον ÎºÎ±Îºá¿¶Ï ÏκέÏαÏθαι δέον. οá½Î´á½³Î½ οá½Î½ á¼Î»Î»Î¿ μοι δοκοῦÏιν
  οἱ Ïá½° ÏοιαῦÏα λέγονÏÎµÏ á¼¢ Ïὴν á½ÏόθεÏιν, ÏεÏὶ á¼§Ï Î²Î¿ÏλεύεÏθαι,
  οá½Ïὶ Ïὴν οá½Ïαν ÏαÏιÏÏάνÏÎµÏ á½Î¼á¿Î½ á¼Î¼Î±ÏÏάνειν. á¼Î³á½¼ δέ, á½Ïι μέν
  ÏοÏ᾿ á¼Î¾á¿Î½ Ïá¿ Ïόλει καὶ Ïá½° αá½Ïá¿Ï á¼Ïειν á¼ÏÏÎ±Î»á¿¶Ï ÎºÎ±á½¶ ΦίλιÏÏον
  ÏιμÏÏá½µÏαÏθαι, καὶ μάλ᾿ á¼ÎºÏÎ¹Î²á¿¶Ï Î¿á¼¶Î´Î±Î á¼Ï᾿ á¼Î¼Î¿á¿¦ γάÏ, οὠÏάλαι
  γέγονεν ÏαῦÏ᾿ á¼Î¼Ïá½¹ÏεÏαΠνῦν μένÏοι Ïá½³ÏειÏμαι Ïοῦθ᾿ ἱκανὸν
  ÏÏολαβεá¿Î½ ἡμá¿Î½ εἶναι Ïὴν ÏÏá½½Ïην, á½ÏÏÏ ÏÎ¿á½ºÏ ÏÏμμάÏοÏÏ
  Ïá½½Ïομεν. á¼á½°Î½ Î³á½°Ï ÏοῦÏο βεβαίÏÏ á½Ïá½±Ïξá¿, Ïá½¹Ïε καὶ ÏεÏὶ Ïοῦ
  Ïίνα ÏιμÏÏá½µÏεÏαί ÏÎ¹Ï ÎºÎ±á½¶ á½Î½ ÏÏá½¹Ïον á¼Î¾á½³ÏÏαι ÏκοÏεá¿Î½Î ÏÏὶν δὲ
  Ïὴν á¼ÏÏὴν á½ÏÎ¸á¿¶Ï á½ÏοθέÏθαι, μάÏαιον ἡγοῦμαι ÏεÏὶ Ïá¿Ï
  ÏελεÏÏá¿Ï á½Î½Ïινοῦν Ïοιεá¿Ïθαι λόγον.

  ÎημοÏθένοÏÏ, δ ᾿ÎλÏνθιακὸÏ

Georgian:

  From a Unicode conference invitation:

  ááá®ááá áá®áááá ááááá áá á áááá¡á¢á ááªáá Unicode-áá¡ ááááá á¡ááá ááá¨áá áá¡á
  áááá¤áá áááªáááá ááá¡áá¡á¬á áááá, á ááááá᪠áááááá áááá 10-12 ááá á¢á¡,
  á¥. áááááªá¨á, ááá áááááá¨á. áááá¤áá áááªáá á¨áá°áá ááá¡ áá ááá áá¡áá¤áááá¡
  áá¥á¡ááá á¢ááá¡ áá¡áá ááá áááá¨á á áááá ááªáá ááá¢áá ááá¢á áá Unicode-á,
  ááá¢áá áááªáááááááááªáá áá áááááááááªáá, Unicode-áá¡ ááááá§ááááá
  áááá ááªáá£á á¡áá¡á¢ááááá¡á, áá ááááá§áááááá áá ááá ááááá¨á, á¨á áá¤á¢ááá¨á,
  á¢áá¥á¡á¢áááá¡ áááá£á¨áááááá¡á áá áá áááááááááá áááááá£á¢áá á£á á¡áá¡á¢ááááá¨á.

Russian:

  From a Unicode conference invitation:

  ÐаÑегиÑÑÑиÑÑйÑеÑÑ ÑейÑÐ°Ñ Ð½Ð° ÐеÑÑÑÑÑ ÐеждÑнаÑоднÑÑ ÐонÑеÑенÑÐ¸Ñ Ð¿Ð¾
  Unicode, коÑоÑÐ°Ñ ÑоÑÑоиÑÑÑ 10-12 маÑÑа 1997 года в ÐайнÑе в ÐеÑмании.
  ÐонÑеÑенÑÐ¸Ñ ÑобеÑÐµÑ ÑиÑокий кÑÑг ÑкÑпеÑÑов по  вопÑоÑам глобалÑного
  ÐнÑеÑнеÑа и Unicode, локализаÑии и инÑеÑнаÑионализаÑии, воплоÑÐµÐ½Ð¸Ñ Ð¸
  пÑÐ¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Unicode в ÑазлиÑнÑÑ Ð¾Ð¿ÐµÑаÑионнÑÑ ÑиÑÑÐµÐ¼Ð°Ñ Ð¸ пÑогÑаммнÑÑ
  пÑиложениÑÑ, ÑÑиÑÑаÑ, веÑÑÑке и многоÑзÑÑнÑÑ ÐºÐ¾Ð¼Ð¿ÑÑÑеÑнÑÑ ÑиÑÑемаÑ.

Thai (UCS Level 2):

  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
  classic 'San Gua'):

  [----------------------------|------------------------]
    ๠à¹à¸à¹à¸à¸à¸´à¸à¸®à¸±à¹à¸à¹à¸ªà¸·à¹à¸­à¸¡à¹à¸à¸£à¸¡à¹à¸ªà¸à¸ªà¸±à¸à¹à¸§à¸  à¸à¸£à¸°à¸à¸à¹à¸à¸¨à¸à¸­à¸à¸à¸¹à¹à¸à¸¹à¹à¸à¸¶à¹à¸à¹à¸«à¸¡à¹
  สิà¸à¸ªà¸­à¸à¸à¸©à¸±à¸à¸£à¸´à¸¢à¹à¸à¹à¸­à¸à¸«à¸à¹à¸²à¹à¸¥à¸à¸±à¸à¹à¸       สอà¸à¸­à¸à¸à¹à¹à¸à¸£à¹à¹à¸à¹à¹à¸à¸¥à¸²à¹à¸à¸²à¸à¸±à¸à¸à¸²
    à¸à¸£à¸à¸à¸±à¸à¸à¸·à¸­à¸à¸±à¸à¸à¸µà¹à¸à¹à¸à¸à¸µà¹à¸à¸¶à¹à¸           à¸à¹à¸²à¸à¹à¸¡à¸·à¸­à¸à¸à¸¶à¸à¸§à¸´à¸à¸£à¸´à¸à¹à¸à¹à¸à¸à¸±à¸à¸«à¸à¸²
  à¹à¸®à¸à¸´à¹à¸à¹à¸£à¸µà¸¢à¸à¸à¸±à¸à¸à¸±à¹à¸§à¸«à¸±à¸§à¹à¸¡à¸·à¸­à¸à¸¡à¸²         หมายà¸à¸°à¸à¹à¸²à¸¡à¸à¸à¸±à¹à¸§à¸à¸±à¸§à¸ªà¸³à¸à¸±à¸
    à¹à¸«à¸¡à¸·à¸­à¸à¸à¸±à¸à¹à¸ªà¹à¸¥à¹à¹à¸ªà¸·à¸­à¸à¸²à¸à¹à¸à¸«à¸²      รัà¸à¸«à¸¡à¸²à¸à¹à¸²à¹à¸à¹à¸²à¸¡à¸²à¹à¸¥à¸¢à¸­à¸²à¸ªà¸±à¸
  à¸à¹à¸²à¸¢à¸­à¹à¸­à¸à¸­à¸¸à¹à¸à¸¢à¸¸à¹à¸¢à¸à¹à¸«à¹à¹à¸à¸à¸à¸±à¸          à¹à¸à¹à¸ªà¸²à¸§à¸à¸±à¹à¸à¹à¸à¹à¸à¸à¸à¸§à¸à¸à¸·à¹à¸à¸à¸§à¸à¹à¸
    à¸à¸¥à¸±à¸à¸¥à¸´à¸à¸¸à¸¢à¸à¸¸à¸¢à¸à¸µà¸à¸¥à¸±à¸à¸à¹à¸­à¹à¸«à¸à¸¸          à¸à¹à¸²à¸à¸­à¸²à¹à¸à¸¨à¸à¸£à¸´à¸à¸«à¸à¸²à¸à¹à¸²à¸£à¹à¸­à¸à¹à¸«à¹
  à¸à¹à¸­à¸à¸£à¸à¸£à¸²à¸à¹à¸²à¸à¸±à¸à¸à¸à¸à¸£à¸£à¸¥à¸±à¸¢           ฤà¹à¸«à¸²à¹à¸à¸£à¸à¹à¸³à¸à¸¹à¸à¸¹à¹à¸à¸£à¸£à¸¥à¸±à¸à¸à¹ ฯ

  (The above is a two-column text. If combining characters are handled
  correctly, the lines of the second column should be aligned with the
  | character above.)

Ethiopian:

  Proverbs in the Amharic language:

  á°áá­ á á­á³á¨áµ ááᥠá á­á¨á°áµá¢
  á¥á á«áá á¥áá°á á£á´ á ááá áá¢
  áᥠá«áá¤á± ááá¥á ááá¢
  á°á á ááá áᤠá£á­á ᣠáá£áµ á áá°ááá¢
  á¨á á áááá³ á áᤠá á­á³á½áá¢
  á á­á¥ á á á á³á á°áá³á¢
  á²á°á¨áá á­á°á¨ááá¢
  ááµ á ááµá¥ ááááá á á¥áá© á­áá³áá¢
  áµá­ á¢á«á¥á­ á áá á³ á«áµá­á¢
  á°á á¥áá°á¤á± á¥áá á¥áá° áá¨á¤á± á á­á°á³á°á­áá¢
  á¥ááá­ á¨á¨áá°áá áá®á® á³á­ááá á á­áµá­áá¢
  á¨áá¨á¤áµ áá£á¥ á¢á«á©áµ á­áµá á£á«á©áµ á«á ááá¢
  á¥á« á¨ááá³áµ ááá ááá³áµá¢
  áá£á­ áá°áªá« á¨ááᥠáááµ á­á á­áá«áá¢
  á¨á¥áµáá á áá© áá« á¨á áá« á áá© áá­á«á¢
  á°ááá á¢á°á á°ááᶠá£áá¢
  áá³áá áá­ á¢áá á¨á­áµá á áµáá°áá¢
  á¥áá­áá á áá«á½á áá­ áá­áá¢

Runes:

  á»á á³á¹á«á¦ á¦á«á á»á áá¢áá á©á¾ á¦á«á ááªá¾áá á¾á©á±á¦á¹ááªá±áá¢á á¹áᦠá¦áª á¹áá¥á«

  (Old English, which transcribed into Latin reads 'He cwaeth that he
  bude thaem lande northweardum with tha Westsae.' and means 'He said
  that he lived in the northern land near the Western Sea.')

Braille:

  â¡â â §â  â ¼â â   â¡â â â â ¹â °â  â¡£â â 

  â¡â â â â ¹ â ºâ â  â â â â â  â â  â â â â  â ºâ ⠹⠲ â¡¹â »â  â â  â â  â â ³â â 
  â ±â â â ⠧⠻ â â â ³â  â ¹â â â ² â¡¹â  â â â â â â » â â  â â â  â â ¥â â â â  â ºâ â 
  â â â â â « â â ¹ â ¹â  â â â »â â ¹â â â â  â ¹â  â â â »â â  â ¹â  â ¥â â â »â â â â »â 
  â â â  â ¹â  â ¡â â â  â â ³â â ⠻⠲ â¡â â â â â â  â â â â â « â â â ² â¡â â 
  â¡â â â â â â â °â  â â â â  â ºâ â  â â â â  â ¥â â â  â °â¡¡â â â â â  â â â  â â ⠹⠹â â  â â 
  â ¡â â â  â â  â â ¥â  â â â  â â â â  â â â ²

  â¡â â  â¡â â â â ¹ â ºâ â  â â  â â â â  â â  â  â â â â â ¤â â â â â ²

  â¡â â â  â¡ â â â â °â  â â â â  â â  â â â ¹ â ¹â â  â¡ â â â ªâ  â â  â â ¹
  â ªâ  â â â ªâ â «â â â  â ±â â  â ¹â »â  â â  â â â â â â ¥â â â â ¹ â â â â  â â â ³â 
  â  â â â â â ¤â â â â â ² â¡ â â â £â  â â â §â  â â â ² â â â â â «â  â â ¹â â â â â  â â 
  â â â â â  â  â â â â â â ¤â â â â  â â  â ¹â  â â â â â â  â â â â â  â â  â â â â â â â â ⠻⠹
  â  â ¹â  â â â â â â ² â¡â ¥â  â ¹â  â ºâ â â â â  â â  â ³â  â â â â â â â â 
  â â  â  â ¹â  â â â â â â â  â â â  â â ¹ â ¥â â â â â ⠪⠫ â â â â â 
  â ©â â â  â â â  â â â â ¥â â  â â â  â â  â ¹â  â¡â ³â â â â ¹â °â  â â â â  â â â â ² ⡹⠳
  â ºâ â â  â ¹â »â â â â â  â â »â â â  â â  â â  â â â â â â â  â â â â â â â â â â â â ¹â  â ¹â â 
  â¡â â â â ¹ â ºâ â  â â  â â â â  â â  â  â â â â â ¤â â â â â ²

  (The first couple of paragraphs of "A Christmas Carol" by Dickens)

Compact font selection example text:

  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
  abcdefghijklmnopqrstuvwxyz £©µÃÃÃÃÃéöÿ
  âââââââ â¢â¦â°â¢ÅŠŸž⬠ÎÎÎÎÎ©Î±Î²Î³Î´Ï ÐÐÐÐÐабвгд
  âââââ§âªâ¡â âââ¨â»â£ ââ¼ââââºâºâ ï¬ï¿½ââá¼ á¸Ó¥áºÉËâ×Ô±á

Greetings in various languages:

  Hello world, ÎαλημέÏα κόÏμε, ã³ã³ããã

Box drawing alignment tests:                                          â
                                                                      â
  ââââ¦âââ  ââââ¬âââ  â­âââ¬âââ®  â­âââ¬âââ®  ââââ³âââ  ââââ   â·  â» ââ¯â ââ°â    â â±â²â±â²â³â³â³
  ââââ¨âââ  ââââ§âââ  ââââªâââ  âââââââ  âââââââ  ââââ  â¶â¼â´âºââ¸â â¼â¨ ââ⥠   â â²â±â²â±â³â³â³
  âââ² â±ââ  ââ   ââ  ââ â ââ  ââ â ââ  ââ â¿ ââ  ââââ   âµ  â¹ ââ·â ââ¸â    â â±â²â±â²â³â³â³
  â â¡ â³ â⣠ â⢠  â⤠ ââ¼ââ¼ââ¼â¤  ââ«ââââ«â¤  â£â¿â¾â¼â¼â¿â«  ââââ     ââââ â ââââ â â â²â±â²â±â³â³â³
  âââ± â²ââ  ââ   ââ  ââ â ââ  ââ â ââ  ââ â½ ââ  ââââââââ â  â â â  â â â
  ââââ¥âââ  ââââ¤âââ  ââââªâââ  âââââââ  âââââââ  ââââââââ â  â â â  â â â
  ââââ©âââ  ââââ´âââ  â°âââ´ââ⯠ â°âââ´ââ⯠ ââââ»âââ  ââââââ   ââââ â ââââ â  ââââââââ
                                               ââââââ

Another way to check if we have UTF-8 support is through the following Python script:

vi testUnicode.py

import sys

if "UTF-8" in sys.stdout.encoding:
    print("△")
else:
    raise Exception("Terminal can't handle UTF-8")

When executed, we will see the following output:

python3.7 testUnicode.py

If it doesn’t work, we will get:

Traceback (most recent call last):  
  File "testUnicode.py", line 6, in <module>  
    raise Exception("Terminal can't handle UTF-8")  
Exception: Terminal can't handle UTF-8

Regarding Htop and MOC, we must export the TERM environment variable before running them. In my case, using Bash, it would be like this:

vi ~/.bashrc

alias htop='export TERM=xterm && htop'  
alias mocp='export TERM=xterm && mocp'

The output of htop without exporting the variable would be the following:

After exporting the variable, the following:

The same thing happens with MOC, without exporting the variable the output would be the following:

Exporting the variable, the following:

The configuration is not overly complicated if you know what you are doing, but to fit all the pieces together, you need several trial-and-error attempts to find the correct combination. I hope this recipe saves some time for more than one person.

If you liked the article, you can treat me to a RedBull here