Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: attempting to achieve something

by choroba (Cardinal)
on Mar 16, 2022 at 16:44 UTC ( [id://11142145]=note: print w/replies, xml ) Need Help??


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

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]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found