How to convert a utf-8 string to a utf-16 string in PHP

Freddo411 picture Freddo411 · Oct 1, 2008 · Viewed 25.3k times · Source

How do I convert a utf-8 string to a utf-16 string in PHP?

Answer

chroder picture chroder · Oct 1, 2008

mbstring supports UTF-16, so you can use mb_convert_encoding.