Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In some programs, such as htop the lines and frames are not displayed correctly. Instead, they are displayed as - and /.

enter image description here

But on another machine, they are displayed correctly as proper lines:

enter image description here

I am not sure if this is a terminal issue, or if perhaps some package is necessary. Can somebody please advise?

In case it is relevant: My system is Debian Wheezy, my interpreter is bash and my terminal emulator is gnome-terminal

share|improve this question
    
Have you tried changing the font used by the terminal? –  goldilocks Oct 26 '13 at 13:23
2  
That would be a possible solution if placeholder characters like a boxes or question marks were in place of the Unicode characters, but his example shows htop displaying ASCII characters. However, if the default terminal font is non-Unicode, then the encoding is likely also, so I've added that to my answer. –  raehik Oct 27 '13 at 15:25

1 Answer 1

up vote 5 down vote accepted

Your top example is running with a non-Unicode locale (i.e. ASCII). Check your $LANG environment variable (try export | grep LANG); you will most likely not find a .UTF-8 suffix. Try adding it:

export LANG=$LANG.UTF-8

Your other example is running with a UTF-8 locale, which should be the default for recent shells. It seems htop detects your locale and displays either ASCII or Unicode characters - so in the bottom picture, you get nice Unicode characters, while with ASCII you get some pretty makeshift ones. I'd suggest changing the locale of the top picture's machine to a Unicode one (see Locale - Debian Wiki).

If that doesn't work, it might be that your terminal emulator is the problem. The default encoding could be non-Unicode. Change the default encoding of your terminal emulator to UTF-8 (in xfce4-terminal I found it in the Advanced tab). If you can't, it might be that your current font doesn't support Unicode: try changing your font to a Unicode one.

[Strangely, I found once I'd changed my locale to ASCII once in a shell session, htop always displays the ASCII characters, even after changing it back. That might be your issue, if for some reason you are changing your locale in your shell occasionally.]

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.