mysql_query("SET NAMES utf8");
apply utf-8 for all relative php/js files.
2. add tinyMCE in php page.
3. remember to trigger the save function before submit on page ajaxCRUD.class.php function insertHeader and function makeAjaxEditor
tinyMCE.triggerSave();
4. decode the fields on function doAction
foreach($submitted_array as $field){ $submitted_values[] = urldecode($field); }
5. encodeURIComponent on function makeAjaxEditor
$return_html .= "" . $field_text . "
6. on file javascript_functions.js
change the charset
http_request.overrideMimeType('text/plain;charset=utf-8');
replace escape to encodeURIComponent for function getFormValues
str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].value) + "&"; var chkValue = encodeURIComponent(fobj.elements[i].value);
7. add to rss files - announcement_.php
echo ""; echo " ";
8. summary
use javascript function encodeURIComponent but escape to encode value
use php function urldecode to decode value
// raw value //شعبية (بالصيني
$str = urldecode('%3Cp%3E%D8%B4%D8%B9%D8%A8%D9%8A%D8%A9%20(%D8%A8%D8%A7%D9%84%D8%B5%D9%8A%D9%86%D9%8A%3C%2Fp%3E'); echo $str;