Today I needed to convert a UTF-16 file to UTF-8 and I did it with iconv:
iconv -f UTF-16 -t UTF-8 /path/to/input > /path/to/output
Today I needed to convert a UTF-16 file to UTF-8 and I did it with iconv:
iconv -f UTF-16 -t UTF-8 /path/to/input > /path/to/output
It was harder to find what I was looking for than seemed reasonable, but eventually I figured out that you can convert a binary field from binary into a hexadecimal string using the MySQL HEX function.
Everything is easy once you know how!
I was doing some research into base conversion and so far have found a function, dec2base, which looks like it might come in handy. There’s an online demo of the function.