Why do my Perl tests fail with use encoding 'utf8'?

前端 未结 3 476
再見小時候
再見小時候 2020-11-30 12:30

I\'m puzzled with this test script:

#!perl

use strict;
use warnings;
use encoding \'utf8\';
use Test::More \'no_plan\';

ok(\'áá\' =~ m/á/, \'ok direct matc         


        
3条回答
  •  广开言路
    2020-11-30 13:15

    It works fine on my computer (on perl 5.10). Maybe you should try replacing that use encoding 'utf8' with use utf8.

    What version of perl are you using? I think older versions had bugs with UTF-8 in regexps.

提交回复
热议问题