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

Re^2: Unicode encoding

by Juerd (Abbot)
on Jun 21, 2009 at 23:49 UTC ( #773433=note: print w/ replies, xml ) Need Help??


in reply to Re: Unicode encoding
in thread Unicode encoding

$str =~ s/\\u([0-9a-fA-F]{4,6})/chr(hex($1))/eg;

It looks like Java unicode escapes. These always have exactly 4 digits as far as I've seen. \u20AC80 would mean 80, but your example would not see it that way :)

s/\\u([0-9A-Fa-f]{4})/chr hex $1/ge;

or die "Can't open file `$file' for writing: $!";

Backticks and apostrophes as balanced quotes are ugly, and not at all balanced, in just about any font.


Comment on Re^2: Unicode 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://773433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2015-07-06 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls