How to fix PuTTY showing garbled characters?
Solution 1
You almost certainly have set the wrong character set in your PuTTY settings.
Verify the character set on the remote system by running the command:
locale
This should return something like:
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
So check your PuTTY settings under Translation and ensure that you have UTF-8
set as the character set.
You may need to tweak the line drawing setting as well, but it is probably not likely.
Solution 2
I had an issue with Debian's aptitude
program even though I had UTF-8 as my characters set. What worked for me was to set the 'Connection > Data > 'Terminal-type string' to 'putty' instead of 'xterm' - apparently Putty ignores the character sequence to switch into drawing mode: http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/utf8-plus-vt100.html
Solution 3
After 15 years I got annoyed once more and googled around again, found this, chose
change settings → window → translation → remote char set → "use font encoding"
and that fixed it.
Solution 4
Also, if UTF-8 is not properly configured, you may run it as mc -ac.
Credits: http://blog.acsystem.sk/linux/midnight-commander-utf8-line-drawing-characters-problem
Solution 5
Window → Translation → "Enable VT100 line drawing even in UTF-8 mode".
This fixes the display of both mc
and wavemon
for me.
Related videos on Youtube
Uwe Keim
German developer. Some of my apps: SharePoint Systemhaus Göppingen (zwischen Stuttgart und Ulm) Eigene Homepage erstellen Test Management Software Windows 10 Ereignisanzeige Very proud father of Felix (2012) and Ina (2014). Loves running, climbing and Indian food. Code Project member #234.
Updated on September 18, 2022Comments
-
Uwe Keim almost 2 years
Connecting from a Windows 7 PC via SSH to an Ubuntu server using PuTTY, I get some screen errors:
I.e. it:
- "Double-draws" the selection inside Midnight Commander (MC).
- Other characters like line elements are drawn as the wrong characters (e.g. "â" instead of "|").
I connected to the same Ubuntu server with a terminal and SHH from a Mac OS X and do not get these screen garbling (i.e. everything looks and works correctly). I've already tried to play with the font settings inside PuTTY, changing it from Courier New to Consolas but without luck.
My question therefore is:
How to configure PuTTY to correctly display special characters and not double-draw/overwrite screen lines?
-
Vunb almost 5 yearsWith SecureCRT: Select Options -> Session Options -> Terminal -> Appearence -> Character encoding -> select: UTF-8. Hope help others like me!
-
Piotr Jurkiewicz over 9 yearsThis is not sufficient in all cases. You should also export the following variable to your environment:
NCURSES_NO_UTF8_ACS=1
[more info] -
Nate about 9 yearsExcellent. Easy and it works. (At least it does on Debian/Ubuntu.)
-
user2693017 almost 9 yearsin case
locale
returnsPOSIX
you probably have usePAM disabled in the sshd config -
koppor over 8 yearsIf the locale returns something like
POSIX
, issueupdate-locale LANG=en_US.utf8
at the command line - see thomas-krenn.com/de/wiki/Locales_unter_Ubuntu_konfigurieren -
ADTC about 8 yearsThis works well (on PuTTY) but then it introduces another (more minor) problem: remote-controlled window title changing no longer works.
-
Michael Hampton over 7 yearsYou should also mention that you're not connecting to a modern LInux system, but an older non-Linux system.
-
alpha_989 over 6 years@michael-hampton, my system is configured to use en_US.UTF-8. I see that different places say different things about locale. Some places mention I should use en_US while other places mention I should use de_DE. I saw before the grep and other core utils use the locale to set the character set, I believe. What are the implicaitons of changing this?
-
alpha_989 over 6 years@koppor, you mentioned about changing locale to en_US, while michael mentioned changing locale to de_DE. Which one is correct?
-
alpha_989 over 6 yearsWhat are the side-effects of changing LANG variable? If you already had C.UTF-8 as LANG, why export it again?
-
alpha_989 over 6 yearsAhh ok, makes sense. Thanks for the explanation @Michael-hompton. Yeah.. I thought so too. But I noticed that you are in NH.. not Germany. So was not sure about whether I should be using that. Anyways, the problem I was having was not related to this, but I figured it out: superuser.com/questions/278286/….
-
weberjn over 6 yearsExcellent. Solved the problem for ncmpc on Ubuntu Artful.
-
HeatfanJohn almost 6 years
export NCURSES_NO_UTF8_ACS=1
worked best for me. I just need to remember to use the-E
option onsudo
when I runiftop
to keep that environment setting.sudo -E iftop
-
Martin over 5 yearsThis fixed it for me.
-
tehnicaorg over 3 yearsYeah, this fixes
aptitude
,iptraf-ng
without breakingmc
. (withTerminal type string
set to eitherxterm
orxterm-256color
). See also superuser.com/questions/278286/… -
tehnicaorg over 3 years
NCURSES_NO_UTF8_ACS=1
is not needed anymore. See superuser.com/questions/278286/… on how to enable VT100 drawing characters in PuTTY 0.71+. -
SergeantSerk over 3 yearsFor me, UTF-8 was already set but it didn't work, instead setting it to this did.
-
Chupo_cro almost 3 yearsWhen I set
Use font encoding
then for examplearmbian-config
characters are OK but they are wrong in Midnight Commander and vice versa - when I setUTF-8
then characters inarmbian-config
are wrong but in Midnight Commader are OK. -
Mr. Beeblebrox almost 3 yearsTHIS is the real answer. If you have it set as UTF8, vt100 line draw does NOT WORK.
-
BrentHarsh about 2 yearsUTF-8 was set for me as well, but it didn't work when I was using "pm2 monit" which updates the screen continuously. Setting "use font encoding" instead fixed that process so I was happy for a few mins. But later on, I used the "pm2 status" command which draws a box on-screen only once... and it was now displaying the garbage characters instead of lines. It's like you can't have both working at the same time. No problem with a plain-old-linux shell terminal though.