General
27 December 2010 5 Comments

How To Fix: Strange Characters in PuTTY

When opening an SSH session from a Windows box to a Linux machine using PuTTY I noticed some strange characters. The text looked like this:

warning: format â%dâ expects type âintâ, but argument 2 has type âint *â

I was puzzled, because I had not had experienced this problem before when using PuTTY. Typing echo $LANG in the bash terminal prompt showed that it was using en_US.UTF-8 as the character set . The problem was caused by PuTTY expecting a different character set (One of the Windows ISO-8859 charsets).

To solve this problem, PuTTY must be configured to speak the same language: UTF8. Here’s how:

  1. Open the PuTTY configure dialogue by clicking in the upper left corner of the window and selecting “Change Settings…” from the menu.
  2. Go to “Translation” on the left side tree menu and select “UTF-8” from the pulldown menu to the right.
  3. Apply the settings.

Now the correct output will show:

warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’
Tags: , charset, iso-8859, putty, , translation, utf-8, utf8

5 Responses to “How To Fix: Strange Characters in PuTTY”

  1. Jess 9 September 2011 at 3:40 am #

    this was awesome. thank you!

    Reply
  2. ArmHead 28 November 2011 at 12:25 am #

    Thanks for the info, helped me out!

    Reply
  3. Chandu 14 December 2011 at 5:03 pm #

    Thanks, that helped me!!

    Reply
  4. Megadeth 5 January 2012 at 12:46 pm #

    Thank you very much ^_^

    Reply
  5. Rob 1 July 2012 at 6:41 pm #

    Thank you. Worked great

    Reply