Summary We explore three different ways to enter Unicode characters in Ubuntu, an important feature for international and multilingual users.
Global users will frequently need to type keystrokes for characters outside of the Basic Latin Unicode character set. Keyboard layouts take care of most of the problem here: if you want to type in a different language, you just use a keyboard layout more suited to the appropriate locale.
But sometimes you're not actually typing in a different language, or you just want to type one specific character that. In that case, you can select a wide range of non-standard and international characters for your documents using a character map application. If you're using the Ubuntu distribution, your desktop environment comes pre-installed with gnome-character-map if you're using Gnome, or kcharmap if you're using KDE.
This can be handy if you don't know exactly what you're looking for, or if you're more of a visual person and need to see things before you know what you want. Most of the time the character map will be sufficient.
Character map is useful occasionally, but not good for rapid entry
But let's say you find yourself pulling up the character map to use a small set of characters frequently. For example, maybe you occasionally need to type reports for a Spanish class and need to make use of the inverted punctuation marks ¡ and ¿. Let's say you want to transcribe the following moderately amusing Spanish joke1:
Un tío ingresa en un hospital para hacerse una pequeña operación. Una enfermera empieza a tomarle los datos. "En caso de emergencia, ¿a quién avisamos?"
"¿Quiere decir si estoy a punto de morirme?"
"Bueno... sí..."
"En ese caso, ¡llame corriendo a un doctor!"
A guy enters a hospital to have a minor operation. A nurse begins to take down his information. "In case of emergency, who should we call?"
"You mean, if I'm about to die?"
"Well, yes..."
"In that case, hurry and call a doctor!"
What are you supposed to do now? It's much too cumbersome to actually bring up the character map all the time to scroll through and find the special characters one at a time. In the above example, you'd have to bounce around to ten different locations in the character set to find them all. You already know what characters you want -- you just need a better way to get them.
Three ways to type special characters
Ubuntu has a few ways to solve this.
Use a different keyboard layout. This is the easiest thing you can do; if you can type any needed special characters directly, you won't need to do anything else special. But your keyboard will be locked in a particular layout until you change it back, so this makes it less efficient if you're only using a few special characters. To change your keyboard layout, you can go to System > Preferences > Keyboard.
Set up whatever layouts you'd like under the Layouts tab. Also, visit the Other Options... dialog here and pick a key combination from the Layout switching list. This makes it easy to switch between keyboard layouts.
Composition shortcuts. Ubuntu also has a composition table, a mapping from sequences of keys called key chords to individual special characters. The composition table for Ubuntu can be found here. If you frequently use a small subset of special characters, composition shortcuts can be a convenient alternative to switching in and out of things constantly.
The composition table describes how to use each key chord to produce the desired character. Each key chord always begins with depressing and releasing the multi key. The default multi key is Shift + Right Alt/AltGr. After that, you type in the characters of each key chord one at a time. The last key of the chord will complete it and produce the desired character.
For example, to type the € symbol (the Euro currency symbol), you can see that one possibility from the composition table is to use [c, =]. In order, you'd do the following:
- Depress
[Shift + Right Alt], then release. - Press
[c] - Press
[=]. - The € character should appear.
Unicode entry mode. The composition table contains most of the frequently used Unicode characters. But sometimes you need to type a specific Unicode character that isn't listed. If that's the case, you can use Unicode entry mode to directly enter the Unicode hexadecimal value for a particular character.
To enter this mode, give any text box focus and hit [Ctrl + Shift + U]. You will see an underlined letter "u" appear. Enter the hexadecimal string corresponding to the Unicode character you want (you may omit leading zeroes). As you type, the text string that's part of your Unicode character will be underlined. Hit [Enter] when you're done and you'll see the character appear.
While you're in Unicode entry mode, you can't use keys other than the numbers 0-9 and the letters A-F in that textbox. Unicode entry mode ends when you move the cursor to a new position in an active textbox, or if you hit [Esc].
One caveat: it's best to stick to the Basic Latin Unicode code page for passwords. But if you want to use Unicode entities in passwords, consider directly entering these characters using one of the other two methods. Some password dialogs don't play well with Unicode entry mode, so you can't tell exactly which parts are part of a character sequence you've just entered.



¡Ubuntu es una maravilla!
but what of wing-ding type characters, like the heart, etc.?
Anyway of using ascii decimal code instead of hex?
The small icons, font pictures don't exist as their own unicode I think, meaning they are not "official". I guess these are just font images placed onto a regular letter-position. So that the heart for example is placed on top the position where the "w" is. You can get free fonts which have all sorts of images instead of letters. I think "dingbats" or "windings" was the name in Windows if I recall it correctly. Unfortunately I don't have my extended bookmarks handy, but here I found dingbats fonts: http://www.fonts4free.net/
Thank you John for writing this instruction, especially the CTRL+Shift+U option was what I was looking for and it took me quite a while to find this function. I would love having the option of just setting the windows key to do the CTRL+Shift+U part for me, so I will research into that.
I also wasn't aware of the character map, what I did was open a font with fontforge, like Linux Libertine font, and then point the cursor to the character and it would pop an infobox with the unicode.
Anyway of using ascii decimal code instead of hex?