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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031573]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2018-03-22 16:05 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (279 votes). Check out past polls.