in reply to Re: attempting to achieve something
in thread attempting to achieve something

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: attempting to achieve something
by choroba (Cardinal) on Mar 16, 2022 at 16:44 UTC
    I still don't see the point, but here's a simpler and more canonical way. It shows how to do it for both an encoded and decoded string.
    #!/usr/bin/perl use warnings; use strict; use Text::Unaccent::PurePerl qw(unac_string); use Encode qw(encode); binmode *STDOUT, 'encoding(UTF-8)'; my $string = "c\N{LATIN SMALL LETTER O WITH CIRCUMFLEX}te"; my $rstring = encode('UTF-8', $string); print "$string $rstring\n"; my $direct = unac_string($string); my $via_bytes = unac_string('UTF-8', $rstring); print "$direct $via_bytes\n"; # cote cote

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
A reply falls below the community's threshold of quality. You may see it by logging in.