How can I treat command-line arguments as UTF-8 in Perl?

后端 未结 5 707
醉酒成梦
醉酒成梦 2020-12-03 08:12

How do I treat the elements of @ARGV as UTF-8 in Perl?

Currently I\'m using the following work-around ..

use Encode qw(decode encode);

         


        
5条回答
  •  醉酒成梦
    2020-12-03 08:27

    Use Encode::Locale:

    use Encode::Locale;
    
    decode_argv Encode::FB_CROAK;
    

    This works, also on Win32, pretty OK for me.

提交回复
热议问题