Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

pack mangles utf output

by roho (Monsignor)
on Aug 28, 2013 at 13:58 UTC ( #1051286=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    my $x = 'FREIGHT  INTRASTATE';
    print $fh $x, "\n";
    print $fh pack('A20',$x), "\n";
    
  2. or download this
    ###################################################################
    # This subroutine pads 'txt' on the right to length 'len'.
    ...
       $len =~ s/^A//i;  # Remove 'A' that system "pack" function uses.
       return sprintf("%s%s",$txt, ' 'x(($len-length($txt))));
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1051286]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-07-24 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls