In sending Unicode document, I need to convert the code point to UTF-8, byte sequence. For example for code point U+1ED2 (Unicode in hex), I need to convert it to a 3 byte sequence: E1 BB 92. Now, the problem is that 'echo' only sends out "ascii string", which is the presentation of the character value, and never the actual byte value. So, how can I generate sequence of bytes, in its true binary value?
I used:
$c = 0xE1;
echo "$c";
That produces the string "E1", which is not 0xE1.
I used
echo sprintf("%c", $c);
That produces the ascii presentation of value "0xE1", which is not a part of the bytes sequence.
Help!!
Thanks,
Ly