5

For example I want to print long dash

I read that it's possible to do with numpad and code of Unicode of character, so I tried doing Alt+Shift+u + code, but without success.

Zanna
  • 72,312
Roman N
  • 429

2 Answers2

5

You want Ctrl and not Alt. This

ctrl+shift+U then 2014enter

is giving me . Note that the output depends on your locale settings.

Zanna
  • 72,312
5

As stated in Ubuntu help page the proper way is the following:

  1. Press Ctrl + Shift + u
  2. Type in hexadecimal code for Unicode character you want to print
  3. Press enter

Alternative approach is to use printf (or echo -e) command in terminal and copy the output. For example, to print copyright sign do

$ printf "\u00a9"                                                              
©
$ echo -e "\u00a9"                                                              
©

Python can do the same, except you need to prepend u in the beginning of hexadecimal string. For instance,

$ python -c 'print u"\u00a9"  '                                                
©

Command line ways can be useful in conjunction with xclip program, which basically copies stuff you give it to clipboard. For example, I could do :

 printf "\u00a9"  | xclip -sel clip
heemayl
  • 93,925