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

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.

Replies are listed 'Best First'.
Re^7: How to display an apostrophe in pod2usage help output.
by Joost (Canon) on Sep 16, 2007 at 21:22 UTC
    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.