Magic!
Could you explain how it works?
I had tried a simple minded unpack('C', $char) but it gave me the wrong answer.
There are two things that I dont understand in your unpack solution
(1) what are the contents of $bytes, and
(2) what is the function of the slash "\" in

\ is the reference operator. Instead of using a file, I open the variable for output (see FILEHANDLE, MODE, REFERENCE in open). I set its encoding to UTF-8 and print the character to it. $bytes now contains the two bytes of the character as encoded in UTF-8.