CP1252 encoding?

Moderator: crythias

Post Reply
frankweis
Znuny newbie
Posts: 1
Joined: 04 Sep 2018, 09:05
Znuny Version: 5s000
Real Name: Frank Weis
Company: CGIE

CP1252 encoding?

Post by frankweis »

Hi all,

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))) ];
    } 
When I create a test script that uses the same function(decode('cp1252', ...) ), it executes without complaining:

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

What can we do to fix this?

Thanks
Post Reply