addAlert("Your options have been saved."); return $objResponse; } function testForm($strText, $formData, $arrArray) { global $useEncoding, $htmlEntities; $objResponse = new xajaxResponse($useEncoding, $htmlEntities); $data = "Text:\n" . $strText; $data .= "\n\nFormData:\n" . print_r($formData, true); $data .= "\n\nArray:\n" .print_r($arrArray, true); $objResponse->addAlert($data); $objResponse->addAssign("submittedDiv", "innerHTML", "
".$data."
"); return $objResponse->getXML(); } $useEncoding = "UTF-8"; $htmlEntities = false; $decodeUTF8 = false; session_start(); session_name("xajaxCharEncodingTest"); if (@$_GET['refresh'] == "yes") { session_destroy(); header("location: charEncodingTest.php"); exit(); } if (isset($_SESSION['useEncoding'])) { $useEncoding = $_SESSION['useEncoding']; } if (isset($_SESSION['htmlEntities'])) { $htmlEntities = $_SESSION['htmlEntities']; } if (isset($_SESSION['decodeUTF8'])) { $decodeUTF8 = $_SESSION['decodeUTF8']; } $xajax = new xajax(); $xajax->setCharEncoding($useEncoding); if ($htmlEntities) { $xajax->outputEntitiesOn(); } if ($decodeUTF8) { $xajax->decodeUTF8InputOn(); } //$xajax->debugOn(); $xajax->registerFunction("setOptions"); $xajax->registerFunction("testForm"); $xajax->processRequests(); ?> Character Encoding Test | xajax Tests printJavascript("../") ?>

xajax Tests

Character Encoding Test

Options Form

NOTE: if you change these options, make sure you click the Save Options button or the options won't be used.

Encoding:
Output HTML Entities? /> Yes /> No
Decode UTF-8 Input? /> Yes /> No

Clear and Refresh

Text Test Form

Here are some Unicode examples you can paste into the text box below. You can see more examples and a list of standard encoding schemes here.