package ILMT::PAN::HIN::WX2UTF; #use strict; #use warnings; use Dir::Self; use Data::Dumper; use IPC::Run qw(run); use List::UtilsBy qw(max_by); use File::Temp qw/ tempfile /; use File::Slurp qw( slurp ); my $cwd = __DIR__; sub process { my %args = @_; utf8::encode($args{data}); my ($fh, $filename) = tempfile("conv111XXXX", DIR => "/tmp", SUFFIX => ".tmp"); #binmode($fh, ":utf8"); print $fh $args{data}; close($fh); my ($fh3, $filename3) = tempfile("convout1111XXXX", DIR => "/tmp", SUFFIX => ".tmp"); #binmode($fh3, ":utf8"); close($fh3); my $wxtoutf1; run ["perl", "$cwd/WX2UTF/convertor-indic-1.4.7/convertor_indic.pl", "-f", "ssf", "-l", "pan", "-s", "wx", "-t", "utf", "-i", $filename], ">", $filename3; my $result = slurp("$filename3"); utf8::decode($result); return $result; }; 1;