Is -C useless?

Paul LeoNerd Evans leonerd at
Fri Sep 12 00:59:30 BST 2008

On Fri, 12 Sep 2008 00:48:06 +0100
Paul LeoNerd Evans <leonerd at> wrote:

>   binmode STDOUT, ":utf8" if grep m/utf-?8/i, @ENV{qw(LANG LC_MESSAGES LC_ALL)};
> And even then I'm not sure it's right.

Actually it's still not... We have to take the first defined one, not try
our best to find one:

  binmode STDOUT, ":utf8" if ( $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG} ) =~ m/utf-?8/i

which -technically- still breaks because we could have  LC_ALL=0  in our
environment, but I think it's close enough.

> Which really just proves my point...

  ... even more.

Paul "LeoNerd" Evans

leonerd at
ICQ# 4135350       |  Registered Linux# 179460
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the mailing list