Sunday, May 21, 2017

"Unabled to retrieve chinese character in xsocket" FIXED!

Tags



Turn out that it is the encoding issue. So what I do is i use below solution. Below function will detect what type of string that being received and convert it into the same type.

iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8", $text);

Solution here

Solution Reference

http://stackoverflow.com/questions/4164719/utf-8-encoding-xml-in-php

http://stackoverflow.com/questions/152006/change-mime-type-of-output-in-php

http://php.net/utf8_encode

http://stackoverflow.com/questions/1354263/how-to-load-xml-when-php-cant-indicate-the-right-encoding

Thanks for watching my blog. Do follow me on google+ or like my facebook page for more! :)
Obstrum Facebook Page


EmoticonEmoticon