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.
As stated in Ubuntu help page the proper way is the following:
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
You want Ctrl and not Alt. This
ctrl+shift+U then 2014enter
is giving me —
. Note that the output depends on your locale
settings.
locale
" without anything to substantiate or explain this. Can you explain? How does it depend on that, and which process's locale settings (since they are in the environment, per process) affect this? The terminal emulator? I am not familiar with any situations where locale settings affect the appearance of characters entered into a terminal, but I am far from an expert on these matters. I think another edit could clarify precisely what you mean; right now, I don't think there's any way for anybody to use the added information.
Commented
Apr 19, 2018 at 20:37