Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: What does utf8::upgrade actually do.

by syphilis (Archbishop)
on Feb 17, 2021 at 12:34 UTC ( #11128492=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Math::GMPz qw(:mpz);
    my $z = Math::GMPz->new();
    ...
    $str = chr(ord $v);
    Rmpz_import($z, 1, 1, 1, 0, 0, $str);
    print $z; # prints the value assigned to $v (ie 255).
    
  2. or download this
    use Math::GMPz qw(:mpz);
    my $z = Math::GMPz->new();
    ...
    utf8::upgrade($str);
    Rmpz_import($z, 1, 1, 1, 0, 0, $str);
    print $z; # now prints 195.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11128492]
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: (2)
As of 2022-05-24 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?