Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: how to convert latin alphabets to hexadecimal number

by kennethk (Monsignor)
on May 01, 2013 at 14:16 UTC ( #1031573=note: print w/ replies, xml ) Need Help??


in reply to how to convert latin alphabets to hexadecimal number

In your format string, you use double quotes with an unescaped backslash. Change line 13 to printf ('\u%X ', ord($_)); to get your desired output.

A little cleaner might be to swap lines 13 and 14 to printf "\\u%X\n\n", ord;

Better still, of course, is to use a package to do interpolation, as the other comments suggest, or actually encode your inputs and outputs properly (perlunitut).


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: how to convert latin alphabets to hexadecimal number
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-12-22 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (126 votes), past polls