AdSense Mobile Ad

Friday, August 28, 2009

Configuring PuTTY to use UTF-8 character encoding

When it comes to Windows (and Windows programs...) it's never late to "learn" something. Or forget something?

Straight to the point: as I needed a terminal to connect to my Solaris box down there, I decided to go for PuTTY. In this laptop I'm running Windows Vista (I'm not joking...) and I didn't want to install Cygwin for such a basic task.

PuTTY doesn't even intall: you just download it and run it. Fine! As soon as I connect, the first surprise.
I'm not a masochist and I didn't chose that directory name! My Solaris user is running with an UTF-8 encoding:


$ echo $LANG
en_US.UTF-8

and PuTTY is simply misunderstanding it. Well, to say the truth it isn't even trying to understand it. When you launch PuTTY you're presented a dialogue. In that dialogue, if you choose the Window/Translation tab, you'll the able to choose the character encoding PuTTY will be using during the translation process of the received data. Just set it to match your other endpoint encoding like this:

Et voilĂ ! PuTTY is printing characters correctly:
Just a remark for the PuTTY guys: Windows/Translation doesn't seem such a good option name, to me, for a character encoding.

12 comments:

JC said...

Thanks for that useful tip. I was getting used to guess what was behind the wrong characters :-P

Cheers

Grey said...

You're welcome, glad it helped!

Sam Trenholme said...

Thank you, very useful tip.

xlf said...

Thank you! Really quick tip and very usefull =)

Anonymous said...

Thank you!

luckfully said...

Thank you. Easy and right!

wirtualne biuro wroclaw said...

thank's but maybe somebody knows how to change encoding permanently? I use your method and any time I restart putty have to do it again....

Omar said...

@wirtualne,

In order to make these changes permanent in Putty, you open up Putty, make the changes you want to save, then click back on the Session window, click on the "Default Settings" under Saved Sessions, and then click on Save. Next time you open Putty whatever you changed prior to clicking save will still be in effect.

Scalp said...

August 2009 tip still is relevant

Anonymous said...

Thanks ! You've made my sad life a bit less sad ! Thank you my favorite solaris addict !

Anonymous said...

Great tip!

gautel said...

Note: you may still get blocks for certain characters because the default fonts like Courier and Lucida Console don't have all unicode chars. Download and install http://dejavu-fonts.org/wiki/Download