case-insensitive regexp match on non-english text in perl cgi script
- by jonny
ok. I have list of catalog paths and need to filter out some of them.
Match pattern comes in non-Unicode encoding.
Tried following:
require 5.004;
use POSIX qw(locale_h);
my $old_locale = setlocale(LC_ALL);
setlocale(LC_ALL, "ru_RU.cp1251");
@{$data -> {doc_folder_rights}} = grep {
$_->{doc_folder} =~/$_REQUEST{q}/i; # catalog path pattern in $_REQUEST{q}
} @{$data -> {doc_folder_rights}};
setlocale(LC_ALL, $old_locale);
What I need is case-insensitive regexp pattern matching when pattern contains russsian letters.