Aha I think I've proven it. I made a test script with just this code.
<?php
error_reporting(E_ALL & ~E_NOTICE);
ini_set("display_errors", true);
// We always want to work from the directory this script is in
chdir(dirname(__FILE__));
// We'll want to buffer everything...
$config = array();
ob_start();
// Setup the smarty class
require('libs/smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = 'templates/default';
$smarty->compile_dir = 'templates/compile';
// include all of the required libraries
require_once("libs/mysql.inc.php");
?>
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
$con = mysql_connect("XXXXX","XXXXX","XXXXX");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("XXXXX", $con);
$result = mysql_query("SELECT post_body from ubbt_posts where post_id = 358825");
while($row = mysql_fetch_array($result))
{
echo "Post Body: " . $row['post_body'];
echo "<br />";
}
mysql_close($con);
?>
</body>
</html>
When I run that code fetching the post_subject, that works perfectly. It gets the subject and displays it.
However, when I change subject to body, it does NOT get the body. I get blankness. So this has nothing at all to do with HTMLSpecialChars. It is a base level issue with bringing UniCode from the database and into PHP to work with it.
Any thoughts are appreciated. I will keep working on it. I found that some people had a similar issue with the combo of IIS / PHP / FastCGI and I tried to deinstall FastCGI but even though the files are gone and the IIS mappings are pointing directly to php-cgi.exe again, PHP reports that it's still using FastCGI. Could that be a registry entry somewhere? I don't think it could actually BE using FastCGI since those files no longer exist
UPDATE: I'll also note just to be clear that when I run that same pair of tests on my ID number that does not have UniCode in it, both work perfectly. So it definitely does show the body of a post that is UniCode-free.