we have the following error:
Error: Unknown encoding 'cp1252' at /opt/otrs-5.0.28/Kernel/cpan-lib/PDF/API2/Resource/CIDFont/TrueType/FontFile.pm line 521.
the following code does this:
Code: Select all
if($data->{issymbol})
{
$data->{e2u}=[0xf000 .. 0xf0ff];
}
else
{
$data->{e2u}=[ unpack('U*',decode('cp1252', pack('C*',0..255))) ];
}
Code: Select all
#!/usr/bin/perl
use strict;
use utf8;
use Encode qw(decode encode);
binmode(STDOUT, ":utf8");
my $runtime = chr(0x0444);
print "theta || ".$runtime." ||";
my $smiley = "\x{0444}";
print "theta || ".$smiley." ||";
my $georgian_an = pack("U", 0x0444);
print "theta || ".$georgian_an." ||";
my $hexstr = "0xF4";
my $num = hex $hexstr;
print $num; # printing the hex value
my $be_num = pack("N", $num);
$runtime = decode( "cp1252",$be_num);
print "\n".$runtime."\n"; # i should have got ф here
Thanks