Image of the glider from the Game of Life by John Conway
Skip to content

It's Unicode, Baby

Okay. I have to share this. It's just too cool not to.

All day today, I was struggling with how to enter Unicode characters in Linux. I really didn't have any reason other than I just wanted to learn. And it didn't make sense to me why it wasn't easy. I just figured entering any Unicode character from the keyboard wouldn't really be that hard. I mean, don't the Chinese, and other languages use Unicode all the time? So it shouldn't be that hard. Not that I speak Chinese or anything, I was just curious.

Well, after digging around the Internet, I found it. It took a great deal of time to find, though. Believe me, this is not heavily documented, as the English language really doesn't rely on Unicode. But the neat thing, is you can use the following keyboard sequence in just about any Gtk+ application. OpenOffice.org, Gnome Terminal, GEdit, Firefox, and so on. So, it could come handy when you want to enter cents instead of dollars, or an actual smiley face rather than colon+paren. At any event, here's how you do it:

Hold down 'ctrl' & 'shift' the entire time while entering the character. While holding them down, press 'U' then the 4 digit octal code for the character. For example, if I want to display the Unicode cent ¢, you would type 'ctrl+shift+U+00A2' then release. You can find plenty of Unicode characters at the official Unicode site or by typing 'gnome-character-map' in a Linux terminal.

Fairly easy, no? The great thing, is the Unicode characters can be entered from just about any scenario. For example, a Windows keyboard connected through Synergy to a Linux computer will work. The Unicode character can be entered inside of screen. Irssi recognizes the Unicode characters just fine, which is a nice addition to my screen digraphs here.

One use that I will have for them is when connected to IRC. It's fun to "show off" the ASCII skillz. Luckily, with irssi, for commonly used Unicode characters, I can setup tab completion. All I need is one letter to start it off, hit 'Tab', and irssi will finish the rest leaving a Unicode character. For example, if I want the ever-so-cool smiley シ (which is really a Katakana Unicode character), then I need 'ctrl+shift+U+30B7':

/completion : シ

Now when I type the colon :, and hit 'Tab', the Katakana Unicode character will be completed for me. This is handy for a TON of Unicode characters, such as the heart, the cent, the British pound and many more.

I hope this is helpful. If it was, please, leave a comment below, and let me know. Of course, if you have cool tips and tricks, those are welcome too. 🙂 Er, I mean, シ.

{ 15 } Comments