From 8a50806e1780c7f43e1063119f05f72af4387bde Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Sat, 20 Feb 2016 10:33:14 +0900 Subject: [PATCH] try Encode for older perls --- t/62_regexp_multibyte_char_class.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/62_regexp_multibyte_char_class.t b/t/62_regexp_multibyte_char_class.t index 49eeff0..8c4b685 100644 --- a/t/62_regexp_multibyte_char_class.t +++ b/t/62_regexp_multibyte_char_class.t @@ -12,6 +12,9 @@ BEGIN { if ($] < 5.008005) { plan skip_all => 'Unicode is not supported before 5.8.5'; } + if (!eval "require Encode; 1") { + plan skip_all => 'requires Encode for this test'; + } } use Test::NoWarnings; @@ -34,8 +37,8 @@ foreach my $call_func (@CALL_FUNCS) { my @vals = @words; my $re = $regex; if ($use_unicode) { - utf8::decode($_) foreach @vals; - utf8::decode($re); + @vals = map {Encode::decode_utf8($_)} @vals; + $re = Encode::decode_utf8($re); } $dbh->do( 'CREATE TEMP TABLE regexp_test ( txt )' );