My tpl calls an ipl which does a search replace and creates a link on content on the basis of definitions stored in some other dcr. This works fine for english content. But when I call the same ipl for spanish it gives encoding issues. I have defined UTF-8 in all xml declaration and also set the BOM for DCT and TPL. I have also defined it for the ipl. Do I need to use any of the perl modules for encoding the text in the ipl?
Here is my ipl code which does the replacement -
for (my $count=0; $count{
my $id = $arrNodes[$count]->value("txtGlossaryId");
my $keyword = $arrNodes[$count]->value("txtKeyword");
my $replacement = "\
".$keyword."\<\/a\>";
$stringVal =~ s/([\W]{1})$keyword([\W]{1})/$1$replacement$2/g;
$stringVal =~ s/([\s]{1})$keyword$/$1$replacement/g;
$stringVal =~ s/^$keyword([\s]{1})/$replacement$1/g;
$stringVal =~ s/^$keyword$/$replacement/g;
}