I was having a few reading problems on a server I've recently got my hands on: the locale is set to something like French UTF8, but Putty was displaying annoying é and stuff instead of accented characters.
I was expecting the solution to be something linuxish like read boring man pages till I finally decide it's not worth the hassle and live with it, but it was so simple that I'm still amazed. Just add the following lines (in your ~/.bash_profile for instance:
- echo -ne '\e%G\e[?47h\e%G\e[?47l'
No idea why it works, if it's for bash or any shell, but well, it just works. Cool ! (via)
Edit: As a few readers commented, there's something way easier to do in your PuTTy configuration. Read comments :)
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/fa
Thnx man, that really hepled.
Thanks again! Your post did save me so much time!!!
Did you set in putty UTF-8 char set?
Configuration -> Window -> Translation -> UTF-8
Santiajo » Oh… My… God. Never saw this setting before… Thanks! :)
Thank u 2!!(Ozh and Santiajo)
This information has change my life!! &;p
espectacular….. no entiendo porque sirve….
Pero funciona perfecto…
Gracias
In PuTTY 0.60 you can change the option "Window > Translation > Received data assumed to be in which character set:" to UTF-8. After this all received data will be interpreted as UTF-8 and displayed correctly.
Damn, might help to read other comments first. Sorry for an allready posted solution. ;)
[…] are quite a few posts on how setting the "Window > Translation > Received Charset" of PuTTY to […]
Hm,
I have been using PuTTY for years.
The first time I'd want to use UTF-8, but I experience a weird thing:
1.) if I set in the Options Translation to "UTF-8", everything gets correctly displayed, but I cannot input any characters beyond U+7F (traditional ASCII, not even Latin-1!!!). (whenever I press a key which has a para-ASCII number assigned, nothing gets sent to the PuTTY terminal. Nothing at all).
2.) if I use the above described method (echo -ne '\e%G\e[?47h\e%G\e[?47l'), I get the same display and I CAN input any unicode number, which is however incorrectly translated to the terminal.
So I'm stuck, actually neither 1), nor 2) helps.
I'd love to hear some tips how to get PuTTY via the Translation-> UTF-8 working…
As a point of clarification, the echo command configures the shell on the remote system (I'm not sure exactly what it does, but it is causing it to echo escape sequences through the console, which are commonly used for controlling various ways the console behaves). The PuTTY setting configures how your client handles data coming from the server. Presumably both your client and the server you are accessing would have to be configured to talk UTF-8 (or some other character set that supports wide characters, as long as they are configured to use the same one). My Debian Etch install with bash appears to handle UTF-8 by default; all I had to do was change the PuTTY configuration to deal with it properly. I would expect that older linux versions, some other distributions, or other shells might have different default configurations.
kick ass dood!
thanks a million!
Thank you very much! This is simple, and it works.
Denis
thanks to the person who said:
"The PuTTY setting configures how your client handles data coming from the server"
that appears to be true:
i looked and on the left side of the putty window, theres lots of menus that i had never looked into, one of them allows you to chose the charset putty uses.. it was ISO something just changed it to UTF8 (and reconnected) and now all the accents show up fine. no need to edit dirty bash files!
Thanks man! This works!
Thanks for this!
Not sure how I overlooked the option of setting PuTTY to use UTF-8. Thanks for the tip.
%G sends xterm terminal (putty) code to select utf-8 character set
[?47h select (dsiplay) xterm aternate screen buffer (it apparaently, amazingly has two screen buffers…)
%G select utf-8 character set again on this screen
[?47l back to normal screen buffer
That is my understanding of it…
retrying shwoing 'esc' within brakcets….
<esc>%G sends xterm terminal (putty) code to select utf-8 character set
<esc>[?47h select (dsiplay) xterm aternate screen buffer (it apparaently, amazingly has two screen buffers…)
<esc>%G select utf-8 character set again on this screen
<esc>[?47l back to normal screen buffer
thank you so much! This works great!
Some Unicode characters (arrows, for example) looks like squares in Courier New font. ? – this symbol, for example. It shows fine in web browser with the same Courier New font.
Oh, crap, it was "North West Arrow" symbol.