views:

883

answers:

1

Does anyone know how to configure the character set translation on plink (the command line version of Putty) to UTF-8? I'm trying to SSH to a Linux server whose character set configuration is UTF-8.

This can be easily achieved via Putty, but I can't seem to find that command line option on Plink...

A: 

You can't find an option because plink doesn't do the character set translation - that's handled by the windows command window. To change the windows command window's character set translation before you start plink use the command "chcp".

To get utf-8, you'll need to first change the console window's font to "Lucida Console". Then, try "chcp 65001".

One caveat - I've found that there's something incredibly slow and inefficient about the windows console when it's doing utf-8 such that if you send data too quickly, plink will blow up and say "A device attached to the system is not functioning".

However, I have to ask - why are you doing this? You should be using putty for anything interactive and for anything non-interactive, if you're redirecting output into a file the translation that the windows console has in effect at the time doesn't matter. The file is then in utf-8, and whatever windows program you're opening it in needs to be told that.

Daniel Martin
Thanks Daniel - last week a coworker of mine also informed me of the fact that the translation piece is handled by the window containing the redirected plink data. As to why am I doing this to being with - I'm using plink to ssh to a linux server from visual studio's build command line (http://msdn.microsoft.com/en-us/library/f35ctcxw.aspx). Effectively redirecting gcc make output from the linux machine over to VS' debugger window. In other words, using VS as a an IDE and the Linux server for compiling C++ code. chcp 65001 in VS didn't work - had to change the default local on Linux to POSIX
Tim Kaddoura