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

后端 未结 5 708
醉酒成梦
醉酒成梦 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 08:16

    The way you've done it seems correct. That's what I would do.

    However, this perldoc page suggests that the command line flag -CA should tell it to treat @ARGV as utf-8. (not tested).

提交回复
热议问题