1

Essentially I have a string of UTF-16 characters that I am getting from a game and it is in UTF-16 and has characters that sometimes just show up as question marks in the browser (Generally non English characters; Japanese/Chinese).

What I want to happen is I get the string then I convert the characters that cannot be displayed in browser to the hex or decimal equivalent so I can output it like Σ or Σ which are both Σ

echo mb_convert_encoding($val, 'HTML-ENTITIES','auto');

The above code has only worked on UTF-8 characters for me.

A solution does not have to convert the entire string but it at least needs to be able to convert a single character, thanks :).

MichaelMitchell
  • 1,069
  • 2
  • 13
  • 38
  • 1
    I don't know much about converting from UTF16 to UTF8, but after doing a little bit of research I found that there are three flavors of UTF16 (http://www.unicode.org/faq/utf_bom.html). Here is another SO article talking about how to convert from UTF16LE to UTF8 to get you hopefully pointed in the right direction: http://stackoverflow.com/questions/6980068/how-to-convert-utf-16le-to-utf-8-in-php – Anil Nov 04 '13 at 04:39

0 Answers0