http://www.perlmonks.org?node_id=913762


in reply to Re: Binary value of string
in thread Binary value of string

I like seeing answers that use both "ord" and "unpack". It brings up a question, is it a binary buffer or a buffer of text? The two methods can give different answers with Unicode. Unpack with "C" will extract values byte by byte, ord always works character by character- which could be multi-byte characters.

If you use "W" with unpack, then it will behave the same as ord.