in reply to Re: What does utf8::upgrade actually do.
in thread What does utf8::upgrade actually do.
But let's say the user instead does a utf8::upgrade of the string, as per the following:use Math::GMPz qw(:mpz); my $z = Math::GMPz->new(); my $v = 255; $str = chr(ord $v); Rmpz_import($z, 1, 1, 1, 0, 0, $str); print $z; # prints the value assigned to $v (ie 255).
The crux of the issue is "what do I (the module author) conclude regarding the expectation of the user that wrote that second block of code ? "use Math::GMPz qw(:mpz); my $z = Math::GMPz->new(); my $v = 255; $str = chr($v); utf8::upgrade($str); Rmpz_import($z, 1, 1, 1, 0, 0, $str); print $z; # now prints 195.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What does utf8::upgrade actually do.
by dave_the_m (Monsignor) on Feb 17, 2021 at 13:58 UTC | |
by syphilis (Archbishop) on Feb 18, 2021 at 14:25 UTC | |
|
Re^3: What does utf8::upgrade actually do.
by roboticus (Chancellor) on Feb 17, 2021 at 17:20 UTC |