Is -C useless?

Paul LeoNerd Evans leonerd at
Thu Sep 11 23:06:39 BST 2008

On Thu, 11 Sep 2008 15:19:17 +0200
Paul Johnson <paul at> wrote:

> Which is just what you seem to have discovered ;-)

In that case, I might have to consider the following:

 package utf8::LocaleAware;

 my $converted = 0;

 sub import
   return if $converted;
   $converted = 1;

   return unless $ENV{LANG} =~ m/\.UTF-8/;

   binmode STDIN, ":utf8";
   binmode STDOUT, ":utf8";

   require Encode;
   map { $_ = Encode::decode_utf8 $_ } @ARGV, values %ENV;

Then just begin every program with

 use utf8::LocaleAware;

But.. you know.. Suuuuurely there must be _some_ way to make -C not

Hell, even this might work:

 BEGIN { exec $^X, "-C", @ARGV unless ${^UNICODE} }

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