Ubuntu – How to input Unicode characters in Kate and Konsole on Kubuntu 18.04

kubuntuunicode

In Kubuntu 18.04 Konsole or Kate applications, I cannot get special characters by enter a Unicode, such as 0x1234 to display 'ሴ'. Ctrl + Shift + U combo key does not work on those applications, but it works on gnome-terminal and other gtk3 applications. How can I type such Unicode characters in Kate or Konsole?

Best Answer

As you observed, many Unicode characters can be entered in gtk-based applications using Ctrl+Shift+u followed by a specific alphanumeric string but such an approach doesn't work at all in Kate or Konsole. This has been the case since 2005 at least.

One has to instead use a Compose key. To do that, open System Settings > Input Devices > Keyboard > Advanced. In there, scroll down to Position of Compose Key. Expand that by clicking on > and choose a convenient key. I chose Caps Lock. Be aware that you'll no longer have the normal function of that key or any other key you set as the Compose key:

Compose Key

Once that is done, create an empty (hidden) file called .XCompose in your home folder and add the following line:

include "/usr/share/X11/locale/en_US.UTF-8/Compose"

Save the file. Then, examine /usr/share/X11/locale/en_US.UTF-8/Compose for suitable code as shown in an answer to How to type unicode characters in KDE?.

Here's a few examples copied from the answer:

  • Compose, v, C   →   Č
  • Compose, ´, E   →   É
  • Compose, _, u   →   ū
  • Compose, ^, i   →   î

If you still find there are symbols that you can't generate in Kate or Konsole such as the one in your question, ሴ, a very, very, ugly workaround is to make a text file in a gtk text editor, generate all the missing symbols there, save the file and then copy/paste as needed into Kate or Konsole whenever you need them. That works just fine and saves the trouble of memorising a list of Unicode characters.