Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Lost in encodings

by Skeeve (Parson)
on Feb 10, 2020 at 07:48 UTC ( [id://11112720] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $charset = [ $charset ] unless ref $charset eq 'ARRAY';
            my $charset_input  = shift @$charset || 'US-ASCII';
            my $charset_output = shift @$charset || $charset_input;
    
  2. or download this
    if ($charset_input ne $charset_output) {
        my $perl_string= $charset_input eq '*internal*'
    ...
            : Encode::decode($charste_input, $string);
        $string= Encode::encode($charset_output, $perl_string);
    }