Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: question on encoding

by Ieronim (Friar)
on Jan 24, 2007 at 16:02 UTC ( #596271=note: print w/ replies, xml ) Need Help??


in reply to question on encoding

You need something like this:

#!/usr/bin/perl use warnings; use strict; use Encode; my $uri = '%C3%A9nfasis'; $uri =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; $uri = decode_utf8($uri); $uri = encode("iso-8859-1", $uri); print $uri;
It prints énfasis.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print


Comment on Re: question on encoding
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-09-02 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls