I'm working with a file type that is comprised of ASCII characters only. Other characters are encoded. Two byte characters are preceded with \X2\
and followed by \X0\
and four byte characters use \X4\
and \X0\
. I can find these easily enough but I'm not sure how to then handle them.
e.g. the character ø
is given as \X2\00F8\X0\
.
My whole string I'm looking for is 100 mm\X2\00F8\X0\
.
How can I get that to a string that I could then say insert into my DB?
I figure I need to use mb_convert_encoding()
But I'm not sure which encoding I want to go to and from.
Any ideas?
Put simply I have "100 mm\X2\00F8\X0\" and I want to output that as "100 mmø"
so all I needed was hex2bin('00F8')
Then utf8_encode(...)
to get it from utf-16 to utf 8