Thai characters not displayed correctly in cms
Posted: Mon Jun 30, 2008 3:55 pm
I made a custom defined tag for translating words from French to Thai and vice versa. While my code works fine on a standalone php page, once the code is run on cms page the Thai characters are replaced by funky characters.
My data is stored in the cms database that I changed to tis620 (table and column as well that stores the Thai script). I set on the global metadata charset=TIS-620 as well... still the Thai characters are not displayed properly. I tried many settings combination without success, don't know anymore where to look at given my poor knowledge.
For info the code:
If ($_POST['cboSearchType'] == 'ThaiWord')
$WordToShow = 'FrenchWord';
else $WordToShow = 'ThaiWord';
include("CustomPages/variables.inc.php");
mysql_connect($MySqlServer, $MySqlLogin, $MySqlPassword) or die(mysql_error());
mysql_select_db($MySqlDb) or die(mysql_error());
$charset="SET NAMES 'tis620'";
mysql_query($charset) or die('Invalid query: ' . mysql_error());
$Sql = "SELECT * FROM tblj_dic WHERE " . $_POST['cboSearchType'] . " = '" . $_POST['txtSearchCriteria'] . "'";
$SqlResult = mysql_query($Sql);
$Row = mysql_fetch_array($SqlResult);
mysql_close();
if ($Row[$WordToShow] == '')
echo 'Pas de resultat pour "' . $_POST['txtSearchCriteria'] . '"';
echo $Row[$WordToShow] . '' . $Row['Tone1'];
Help would be greatly appreciated!
My data is stored in the cms database that I changed to tis620 (table and column as well that stores the Thai script). I set on the global metadata charset=TIS-620 as well... still the Thai characters are not displayed properly. I tried many settings combination without success, don't know anymore where to look at given my poor knowledge.
For info the code:
If ($_POST['cboSearchType'] == 'ThaiWord')
$WordToShow = 'FrenchWord';
else $WordToShow = 'ThaiWord';
include("CustomPages/variables.inc.php");
mysql_connect($MySqlServer, $MySqlLogin, $MySqlPassword) or die(mysql_error());
mysql_select_db($MySqlDb) or die(mysql_error());
$charset="SET NAMES 'tis620'";
mysql_query($charset) or die('Invalid query: ' . mysql_error());
$Sql = "SELECT * FROM tblj_dic WHERE " . $_POST['cboSearchType'] . " = '" . $_POST['txtSearchCriteria'] . "'";
$SqlResult = mysql_query($Sql);
$Row = mysql_fetch_array($SqlResult);
mysql_close();
if ($Row[$WordToShow] == '')
echo 'Pas de resultat pour "' . $_POST['txtSearchCriteria'] . '"';
echo $Row[$WordToShow] . '' . $Row['Tone1'];
Help would be greatly appreciated!