Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make GNU screen recognize UTF-8 characters [closed]

I like to have different prompts in bash to recognize quickly on which machine I am currently working when I use ssh. I found that the default bash terminal in OSX Yosemite accepts a wide range of unicode characters, so I set up these PS1:

Mac PS1

PS1=$'\n\n\xf0\x9f\x98\x88'"  \t โ€“ \[\033[01m\]\u@\h\[\033[00m\]:\W > "

Raspberry ฯ€ PS1

PS1=$'\n\n\xf0\x9f\x98\xBA'"  \t โ€“ \[\033[01m\]\u@\h\[\033[00m\]:\W > "

Unfortunately, GNU screen does not understand UTF-8 characters:

  • F0 9F 98 BA ๐Ÿ˜บ http://unicode-table.com/fr/1F63A/
  • F0 9F 98 88 ๐Ÿ˜ˆ http://unicode-table.com/fr/1F608/

even when run in UTF-8 mode with screen -U

Any idea how to solve this problem?

like image 461
nico Avatar asked Feb 27 '15 10:02

nico


People also ask

How do I display the UTF-8 terminal?

Go to the language settings, click Administrative language settings, then Change system localeโ€ฆ and tick the Beta: Use Unicode UTF-8 for worldwide language support option.

Is UTF-8 the same as Unicode?

The Difference Between Unicode and UTF-8Unicode is a character set. UTF-8 is encoding. Unicode is a list of characters with unique decimal numbers (code points).


1 Answers

1) In GNU screen type CTRL+A, then type this screen directive:

:utf8 on

(Not sure why -U does not already do it.)

2) Also check your locale by typing "locale -a" in a shell.

This should have UTF-8 near the top of the output.

like image 165
Svetlana T. Avatar answered Oct 02 '22 22:10

Svetlana T.