Linux – Weird symbols always appearing in command line (putty / zsh)

command-line-interfacelinuxputty

I've had this problem for a while and I hope it's a pretty easy fix:

In various places, I'll see weird symbols appearing in the command line. Such as 'â'.
It seems like it's replacing some other character..? For example, when I do

prompt -p

I'll get lots of 'â symbols. Such as:

fade theme with parameters `white grey blue':
ââââuser@hostââââ Sun Sep 05 05:57:20pm
_cwd}~/ command arg1 arg2 ... argn

user and host replaced my actual user / host, but everything else looks exactly like that.

I've also seen those symbols in g++ compiler messages, such as:

test.cpp: In function âint main()â:
test.cpp:6: warning: unused variable âxâ

What's going on and what can I do to fix it? The shell I'm using is zsh (but I also see the symbols in bash). I'm using ubuntu and putty. Thanks!

Best Answer

Your PuTTY character set and your terminal character set don't match. Use echo "$LANG" and look after the period for what it should be, and set it in PuTTY.