in reply to Re^4: How to display an apostrophe in pod2usage help output.
in thread How to display an apostrophe in pod2usage help output.

I don't know putty that well, but I assume you can set it to UTF-8 mode. Possibly you could make UTF-8 the default.

That would probably be the more useful option (the other option is to disable UTF-8 entirely)

See also http://www.earth.li/~huggie/blog/tech/mobile/putty-utf-8-trick.html for a way to force putty to utf-8 from the server.

  • Comment on Re^5: How to display an apostrophe in pod2usage help output.

Replies are listed 'Best First'.
Re^6: How to display an apostrophe in pod2usage help output.
by dbmathis (Scribe) on Sep 16, 2007 at 20:31 UTC
    So based on what you have already told me, this seems to work. Is this safe?

    if ( $help ) { $lang = $ENV{'LANG'}; $ENV{'LANG'} = 'C'; pod2usage(-verbose => 2 ); $ENV{'LANG'} = $lang; }
    After all this is over, all that will really have mattered is how we treated each other.
      That will work given your current situation.

      Two problems:

      1. it won't fix any problems with other programs (like man) that look at the locale to determine the encoding.

      2. if someone does set their terminal encoding to utf-8 (or uses another terminal that defaults to utf-8, which the systems local terminals almost certainly do) it will mess up 8-bit "extended ascii" characters (like latin-1, or whatever the system thinks uses by default).

      IOW, you're almost certainly better off in the long run if you configure the terminal(s) to use UTF-8. Unless you're 100% sure you're never going to have to read anything but latin-based characters - or perl 6. Then you could just set the systems' default LANG to C instead of hacking around the problem by ignoring the locale.