In: , , , ,
On: 2007 / 08 / 03 Viewed: 85436 times
Shorter URL for this post: http://ozh.in/fa

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:

CODE:
  1. 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 :)

Related posts

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/fa

Metastuff

This entry "How To Display UTF8 in your Putty Bash Shell" was posted on 03/08/2007 at 10:05 pm and is tagged with , , , ,
Watch this discussion : Comments RSS 2.0.

13 Blablas

    Pages: [2] 1 » Show All

  1. 13
    Denis France »
    thought, on 30/Dec/09 at 8:05 pm # :

    Thank you very much! This is simple, and it works.

    Denis

  2. 12
    tom3k Singapore »
    said, on 10/Jun/09 at 4:23 pm # :

    kick ass dood!

    thanks a million!

  3. 11
    sempernoctis United States »
    commented, on 31/Mar/09 at 5:47 pm # :

    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.

Pages: [2] 1 » Show All

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?

Close
E-mail It