Debugging character encoding issues for Karin
Posted by mholmes on 18 Jan 2007 in Activity log
Spent quite a while trying to figure out why UTF-8 strings were being rendered wrongly in response to a PHP query to a mySQL db. It turned out that PHP was working with the strings as 8859-1, rather than UTF-8, and that's what it was spitting out at the end. For characters which are in the 8859-1 range, a call to utf8_encode() on any string being echoed into a page works OK, but it's not a proper solution because anything not in that range (such as a Japanese character) isn't handled. The solution may lie in explicit settings in the php.ini file.