Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: how to convert latin alphabets to hexadecimal number

by kennethk (Abbot)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031573]
help
Chatterbox?
What's the matter? Cat got your tongue?...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-02-27 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (393 votes). Check out past polls.