How can I type a Unicode character (for example, em-dash —?)

The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —?


Solution 1:

  • Ctrl+Shift+U, then 2 0 1 4 and Enter

or

  • Ctrl+Shift+U+2014

Control-capital-u means Unicode, and the four-digit hexadecimal number for em dash (or any other Unicode character) can be found via the Character Map in Ubuntu (gucharmap).

The first option allows you to separately type the correct digits for your character, which appears upon hitting Enter or Space. You can also edit the numbers you typed using backspace before pressing Enter.

If this shortcut doesn't work check if your input method is iBus.

Solution 2:

I could not find a way to type it using AltGr and default settings, but I found another way:

  1. Go to System -> Preferences -> Keyboard.

  2. Select the Layouts tab.

  3. Click Options.

  4. Under Compose Key Position (drop-down), choose a key to use for composing — I chose the Right Win (right Windows key).

  5. Now press and release the compose key, then type --- to get the em-dash.

[Here's a list of more characters you can type this way.]


UPDATE: As of Ubuntu 12.04

  1. Go to System Settings > Keyboard.

  2. Under Typing tab, select Layout Settings link (at the bottom of the dialog box).

  3. Click Options.

  4. Under Compose key position (drop-down), choose a key to use for composing — I chose the Right Win (right Windows key).

  5. Now press and release the compose key, then type --- to get the em-dash.