$ perl -MEncode=encode,from_to -wle'$s = encode("UTF-8", chr(0x2660)); from_to($s, "UTF-8", "ascii", Encode::FB_XMLCREF); print $s' | od -c 0000000 342 231 240 \n 0000004