Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Losing Bits with Pack/Unpack

by BillKSmith (Monsignor)
on Sep 18, 2020 at 15:27 UTC ( #11121926=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $_hex_text = sprintf '%X' x scalar(@_code_points), @_code_points;
    my $_text = pack 'H*', $_hex_text;
    print $_text;
    
  2. or download this
    use strict;
    use warnings;
    ...
    
    is($_text, $text, 'Restored text');
    
  3. or download this
    1..2
    ok 1 - Number of Unicode characters
    ok 2 - Restored text
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11121926]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-01-21 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?